
var target : Vector3; 
var targetRadius : float = 3;
var speed : float = 200;


function OnStart() 
{
}

function Update () 
{
	var dir : Vector3 = target - transform.position;
	var dist = dir.magnitude;
	dir = dir.normalized;
	
	if (dist > targetRadius)
	{
		transform.Translate(dir * (Time.deltaTime * speed));
	}
}

function OnDrawGizmos ()
{
	Gizmos.color = Color(1, 0, 0);
	Gizmos.DrawWireSphere(target, 0.5);
}