Solgryn

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 ? ' ^'
User avatar
Solgryn
Posts: 43

Pharan

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.
User avatar
Pharan

Pharan
Posts: 4431

Solgryn

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.
User avatar
Solgryn
Posts: 43


Return to Unity