Hi i'm trying to make a camera move to a location and then stop using java script.
Here is my attempt at it.
var speed : float = 0.2;
var myPosition : float = 0;
var myPos : boolean = true;
function Update(){
myPosition = transform.position.z;
if (myPosition < 20.21);
myPos = true;
}
function Start(){
var myPos : boolean = true;
do
{
Check();
}while(myPos == false);
}
function Check(){
this.transform.position += this.transform.forward * this.speed;
}
↧