• Unity
  • Time.timeScale and still play animation on specific object.

Hi,

In my game I have a pause menu where I set the Time.timeScale in unity to 0. I've got the UI on Update() so it still works, but I want to have a model of the playable character on the pause screen as well.

Is there any way for the specific model on the pause screen to play animations as normal, unaffected by Time.timeScale ? ' ^'

Related Discussions
...

I think we added an unscaled time mode to SkeletonGraphic a while back. Let me check.


24 Jul 2017 12:51 pm


Yeah, SkeletonGraphic has the "Unscaled Time" checkbox. Just use that.

If you're using SkeletonAnimation, you have to do the following:

  1. Uncheck "Clear State on Disable" under Advanced. I think this is disabled by default anyway.
  2. Disable the component (uncheck its checkbox in the inspector, or skeletonAnimation.enabled = false in code).
  3. In Update in a separate script, call skeletonAnimation.Update(float deltaTime) and skeletonAnimation.LateUpdate() yourself.

the float deltaTime you pass yourself will need to be the unscaled time.
This is also more or less how you would do it if you wanted the SkeletonAnimation to do fixed-time frame-skipping or some other stylistic or optimization tricks.

Thanks, SkeletonGraphic will do ( ' v') I'm using it on a canvas so it makes more sense, too.
Didn't really think to use a different skeleton, I've just always used SkeletonAnimation.