Prerequisites: The game is paused with Time.timescale =% in the project
issue: after pausing the game, the button that pauses the interface may need to play an idle animation, time.timescale=0 will affect the animation playback.
Factors affected by Time.timescale:
1. Physical simulations. Fixedupdate-When time.timescale=0, the Fixedupdate function is not executed.
2.Coroutines. -The Time.timescale=0 function does not stop, but it stops waitforseconds. The covariant function still triggers every frame, but Waitforseconds uses the current time.deltatime to become 0.
3.Invoke and invokerepeating. -The specified function is dropped after a delay of some time.
4.Particle system particle systems.
5.Animations. Animation. If we are using animator, we can set the effect of animation ignoring Time.timescale. Just set the UpdateMode to Unscaled time, set as follows:
Factors not affected by Time.timescale:
1.update-time.timescale does not affect the call to update, and update is always called. But if time.deltatime=0, the following implementations will not work:
function Update () { //Move the object meters per second! var translation = Time.deltatime *; Transform. Translate (0, 0, translation);}
The 2.ongui-ongui and corresponding event implementation principles are not based on time.timescale and are therefore unaffected.
Reference:
- Http://gamedevdocket.blogspot.com
- http://answers.unity3d.com/
- https://unionassets.com/blog/playing-animation-with-time-timescale-0-339
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"One of Unity game development" Time.timescale=0 play animation in the event of a paused game