#pragma strict
var WayPoints : Transform;
var speed : float = 20;
function Start () {
}
function Update () {
var target : Vector3 = WayPoints.position;
var moveDirection : Vector3 = target - transform.position;
var velocity = rigidbody.velocity;
if(moveDirection.magnitude < 1){
velocity = Vector3.zero;
}
else{
velocity = moveDirection.Normalize * speed;
}
rigidbody.velocity = velocity;
}
i have this error and idont know how to fix it
Operator ‘*’ cannot be used with a left hand side of type function(UnityEngine.Vector3)