Hello, my endGame function doesn’t work properly,
if(myCounter > 3){ chooses the wrong level to load.
Does anyone know why that is the case?
var myCounter : float;
function Update () {
Debug.Log (myCounter);
}
function Start () {
endGame ();
}
function OnTriggerEnter ( other : Collider) {
myCounter += 1.0;
}
function endGame (){
yield WaitForSeconds (15);
if(myCounter > 3){
Application.LoadLevel ("Level_01");
} else {
Application.LoadLevel ("GameOverScreen");
}
}
Please format the code before posting on UAnswers. I'll do it this time.
– Lovrenc"chooses the wrong level to load". So which level does it load?
– tanoshimi