- Home /
How to pause the game but keep an animation of a game object running?
So I want to pause the game when the character dies(game over) but I want to continuously loop his death animation until the user decides to restart the game. Setting Time.timeScale to 0 is obviously not the answer. Then I saw this 2009 thread and I think @Jerrod Putman's answer will help me http://answers.unity3d.com/questions/7544/how-do-i-pause-my-game.html
If you set Time.timeScale to 0, yet you still want to do some processing (say, for animating pause menus), remember that Time.realtimeSinceStartup is not affected by Time.timeScale. You could effectively set up your own "deltaTime" in your animated menus by subtracting the previous recorded Time.realtimeSinceStartup from the current one.
But I just couldn't understand how to implement it.
Hi, have you tried pausing the game with Time.timeScale like you did and at the same time changing the player's animator component's Update$$anonymous$$ode (Animator.update$$anonymous$$ode) to UnscaledTime. This will tell Unity to continue playing the animation even when the time scale is 0.
The reason you may want to not set the Animator's Update$$anonymous$$ode to UnscaledTime in the scene or prefab data = for the whole game is that if you have some slow time effects or regular pause in the game, you want the player's animation to stop/be slowed down because it's using the "normal" setting.
Answer by Xaverix · Oct 09, 2017 at 05:26 PM
In your animator there's a dropdown called "Update Mode", setting it to "Unscaled Time" should fix your problem
Your answer
![](https://koobas.hobune.stream/wayback/20220612140623im_/https://answers.unity.com/themes/thub/images/avi.jpg)