Hi !
I’ve one problem.
I want to move an object to his original position to a point B, wait for seconds then, return to original position and destroy him.
Here my code :
var endPoint : Vector3;
var duration : float = 1.0;
private var startPoint : Vector3;
private var startTime : float;
function Start() {
startPoint = transform.position;
startTime = Time.time;
}
function Update() {
transform.position = Vector3.Lerp(startPoint, endPoint, (Time.time - startTime) / duration);
yield return new WaitForSeconds(70);
Destroy( this.gameObject );
}
But he doesn’t work.
Some help please ? ^^