How would I make an object move from the position of object A, to the position of object B to the position of object C and then to A, etc. at a constant speed? I have tried looking into the “moving platform” script from the 2D platform tutorial from the unity resources but the speed seems to be based only on two objects, how can I have it be more (and at a constant speed)? Here is the script.
> var targetA : GameObject; var targetB
> : GameObject;
>
> var speed : float = 0.1;
>
> function FixedUpdate () {
> transform.position =
> targetA.transform.position * speed
> + targetB.transform.position * speed; }
and here is a modified version (mine) that, when applied to an object, appears to do nothing(I am getting no errors though).
var targetA : GameObject;
var targetB : GameObject;
var speed : float = 0.1;
function FixedUpdate () {
transform.position = targetA.transform.position * speed
+ targetB.transform.position * speed;
}
Thanks