Hello guys , i have two functions (RotateRight & RotateLeft), please how i can choose one of two functions to execute one of them randomly when the script executing !!
i try this code :
var functions = [RotateRight,RotateLeft];
function Update(){
if(Timer1>=2){
functions[Random.Range(0,functions.Length)]();
}
if(Timer1>=5){
TranslateBack = false ;
TasadomDone = true ;
Timer1=0 ;
}
}
the problem here that the script execute this : functionsRandom.Range(0,functions.Length);
and still choose between the two functions without execute the next Lines .
where id the problem here ??!
i want every time choose one of two functions only , then executing the next lines .
sorry for question , i,m a beginner , and sorry for my english