- Home /
How to pause Time(Time.timeSinceLevelLoad)
Hi, I've got question. How to stop time? I'm want to pause Time.timeSinceLevelLoad, and renew it...
Answer by Bunny83 · Jan 27, 2011 at 06:39 PM
Just set Time.timeScale to zero. That will stop all times except Time.realtimeSinceStartup. If timeScale is set to 0 FixedUpdate is not being called anymore.
See the Time class for more information.
You Should $$anonymous$$ake His Answer As Correct (Click the check mark by the up-down arrows)
Setting Time.timeScale to zero will cause other time based calculations to stop also. What if I want to make an up-counting $$anonymous$$utes-seconds timer that should start after a delay and keep running those time-based calculations simultanously?
function Timer(){
$$anonymous$$utes = (Time.timeSinceLevelLoad/60)-1;
seconds = (Time.timeSinceLevelLoad % 60)-delay;
timer.text = "Time: <color=#ffbf00>"+$$anonymous$$utes.ToString("00")+":"+seconds.ToString("00")+"</color>";
}
This will not work correctly as "60 - delay" will reset the seconds and $$anonymous$$utes. $$anonymous$$g. delay = 3 -> so if seconds reach 57, they will be resetted to 0.
Your answer
Follow this Question
Related Questions
Pausing an Invoke for a time 2 Answers
Ideas for Animating while Paused? 9 Answers
Audio keeps playing when paused 1 Answer
Timer delay 1 Answer
Pause menu doesn't pause everything 0 Answers