Hi, I need some help on this. How do I translate the object only one time?
code below got 2 problem, first I can’t put the FixedUpdate function inside If else.
help me please…thanks in advance
static var callerPath = false;
if(callerPath == true){
function FixedUpdate () {
transform.Translate(0,10,0);
}
}
Not quiet sure what you are trying to obtain but, nonetheless why don’t you just turn it around?
Something like this:
static var callerPath = false;
function FixedUpdate (){
if(callerPath) // You dont need to type: == true when you are checking if it is true.
transform.Translate(0,10,0);
}
else{
transform.Translate(0,-10,0);
}
}
I am not a 100% sure what you want but, this is properly a step in the right direction.