- Home /
Time.timescale = 0 causes no display of Pausemenu
Hello, I want to show a pause-menu and pause the game with "Time.timescale = 0" when I am clicking on the pause-button. But this current situation is really a dilemma, because I have animation-transitions on the Pause-menu that fades it in the center of the screen. This transition-system is by 3DBuzz's "GUI-Development" https://www.youtube.com/watch?v=QxRAIjXdfFU (Handled by 2 Scripts MenuManager, Menu). Therefore I have 2 actions in the onClick()-Container of the pause-button { 1. MenuManager.ShowMenu(PauseMenu), 2. ButtonListener.onPause() } .
When I press on the pause-button the game stops, but infact there is an animation which is dependent on the current timescale (because of Time.timescale at the onPause() in script -> 0) the animation could not be played, so the pause-menu did not show up.
When I disable the timescale-line (-> stays always 1) the animation is played so that we see the pause-menu, but now the game is not paused.
Time.timescale is here not good to change because the animation is handled by time and on the other side we want to stop the game.
I have thought about a yield-command in the onPause-function so that the script waits the pause-menu has fade in and then sets its timescale to 0, but this don't work either.
How do I fix this issue?
Answer by Baste · Apr 20, 2015 at 07:20 AM
myAnimator.UpdateMode = AnimatorUpdateMode.UnscaledTime;
Which ensures that the "Animator updates independently of Time.timeScale"
Your answer
Follow this Question
Related Questions
I need to prevent my scroll bar from moving the camera behind the panel 2 Answers
Resume Game with Timescale + Score? 1 Answer
Pause menu doesn't pause everything 0 Answers
Controlling pause menu with keyboard in Unity 4.6? 1 Answer
hi i just got the ultimate fps camera and it is not compatible with pausemenus 0 Answers