So I have a timer which counts down and when it gets to 0 it goes -1, -2 which I don’t want it to do, I just want it to stop a 0
I tried adding this code
if(Time.deltaTime==0)
Debug.Log(“game over”);
but it’s not working
Here is the full code
#pragma strict
var myTimer : float = 5.0;
function Start () {
}
function Update () {
myTimer -= Time.deltaTime;
GetComponent(GUIText).text = parseInt(myTimer).ToString();
if(Time.deltaTime==0)
Debug.Log("game over");
}