- Home /
How to stop a countdown from counting down
Hi, please anyone can assist me finding out how to stop my counter from running when it reaches a certain number. In my case i would like to stop the counter and set another object Active. I looked around for answers but i am not able to find the answer. Here is the current script i have running the counter...Thank you and I really appreciate. var objectActive: GameObject; var timer : float;
function Start () { objectActive.SetActive(false);
}
function Update ()
{ timer += Time.deltaTime;
guiText.text = timer.ToString();
if( timer == 5){
objectActive.SetActive(true);
}
}
the chances of the timer equaling 5 at the exact moment you check the timer are really low!
Ins$$anonymous$$d check if the timer is >= 5
Your answer
Follow this Question
Related Questions
countdown/countup timer 1 Answer
C# countdown timer 9 Answers
How to add a counter on screen! 2 Answers
How to restart a level with countdown? 4 Answers
Countdown timer into text c# 1 Answer