- Home /
Question by
Mark 6 · Sep 16, 2010 at 01:34 PM ·
gameobjecttimercountdown
Count down on gameobject
Hi,
What i want to do is have a timer that attached to a gameObject for a invinceable count down. This timer will be placed on top of the gameobject for the user to see it count down.
Is there any way that the count down number from a script can be attached in this way?
Thanks
Comment
Answer by AliAzin · Sep 16, 2010 at 03:00 PM
A simple way to count down is using yield, for example :
vat timer : int = 10;
function Start(){ CountDown();
} function CountDown(){ while (timer >= 0){ yield WaitForSeconds(1); timer--; } }
Your answer
![](https://koobas.hobune.stream/wayback/20220613073328im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Need help figuring how to add more time to timer 1 Answer
Timer script running too fast 1 Answer
Timer going negative...Help 2 Answers
Countdown timer trouble? 1 Answer
CountDown Timer Help (Seconds problem) 2 Answers