Hi. I’m trying to add a delay to my moving platform script. It does delay, but then it synchs up with the other prefabs.
static var Waypoint : boolean = true;
var pointB : Transform;
private var pointA : Vector3;
var speed = 1.0;
var delay = 0;
function Start () {
yield WaitForSeconds(delay);
if(Waypoint == true) {
pointA = transform.position;
while (true) {
var i = Mathf.PingPong(Time.time * speed, 1);
transform.position = Vector3.Lerp(pointA, pointB.position, i);
yield;
}
}
}