How to stop a countdown timer and disable/stop everything in the scene?
I'm working how to stop a timer and show "Out of time" on the UI text that used to show the remaining time when the count reach zero. However, the bool gameOver in the Update() didn't check and turn itself to true when the time reach zero.
What can i do if i want to freeze everything once the time reach zero?
Answer by nopogo · May 04, 2016 at 01:39 PM
What you could do is set the timescale with a coroutine that has the same delay as the visual counter and gets called as soon as the timer starts running.
If you want to "freeze" everything in the scene you can manually set the speed of the time unity uses with:
Time.timeScale = 0;
Fixed with other method, thank you. Btw, it is kind of difficult to use coroutine.
what if we wanted to just stop the timer, not the whole scene?
Your answer
Follow this Question
Related Questions
Race saving best times on different scene 0 Answers
Timer Countdown Pop Up Screen Before Scene "Starts" Please Help!! 2 Answers
How to use UI button in Update()? 1 Answer
UI Text is not being rebuilt/updated in edit mode, when changing text from OnInspectorGUI 1 Answer
Layer mask has a weird interaction 0 Answers