• Unity
  • Spine Animation does not play when using Unscaled Time

  • Змінено
Related Discussions
...
4 дні пізніше

Hi! I recently started using Spine on my game as I want to implement cinematics using animated meshes. I need these animations to play on Unscaled Game Time but somehow the animation is always playing in Scaled Time, even if I switch it manually from script.

Is this normal? Is there an option I'm missing? 😢

I'm using Unity 2018.4 and Spine Runtime 4.0 + Timeline extensions and playing the animation using the Playable Director

Any help would be kindly appreciated, thank you!


Nevermind, fixed it by deciding to drop the PlayableDirector / Timeline use (as it couldn't be controlled not even by script, even the PlayOnAwake function was being called even though I had it deactivated).
Instead I controlled the animation using the SkeletonAnimation script and updated the animation manually using unscaled time.

If anyone knows anything though please let me know, not sure but I may need use the Timeline in the future.

We're sorry for the troubles!

We just added an UnscaledTime property to the SkeletonAnimation component in this commit on the 4.1-beta branch (it will be part of the next unitypackage release). You can enable it to play your Spine animations independently of game time, ignoring Time.timeScale. This parameter already existed at the SkeletonGraphic component to animate UI elements, now SkeletonAnimation provides this functionality too.

We would like to also add an option to the spine-unity Timeline integration to automatically sync this setting of the SkeletonAnimation component to the Director setting, unfortunately we're not sure about what the best way to provide such a sync-property would be: it could be added at the SkeletonAnimation component, at the Track, at the Clip, or let the Clip override the time scale mode all-together. Could you please describe your use-case, what you have in mind? We would like to provide a solution that solves as many use-cases as comfortably as possible.

Hello there!
Thank you so much for your help! Glad to hear there's a work around, not sure if I'll use it right now that got everything working manually but might need it in the future when more Spine Cinematics are added for the game's story.

In my case, I'm using the Timeline for game cinematics, started using one for when you defeat a boss (so I can test everything with something simple) and so far I liked the easy approach, but I really needed the whole cinematic to be game time independent as there's lot of hitstop on the game and the animation was looking all weird when being updated with scaled time.
I think the best bet is adding the sync option at the Track, in my case having it at Skeleton Animation would be enough, but there may be cases where you want a second track to be scaled.

Thanks again for being so cool! :cooldoge:

Thanks for your kind words. 🙂 Indeed adding the property per track turned out to be the best solution from our point of view as well. We have just added the Unscaled Time property at SkeletonAnimation Track and SkeletonGraphic Track (in this commit).

Details from the changelog:

changelog.md написав
  • Timeline SkeletonAnimation Track and SkeletonGraphic Track now provide an Unscaled Time property. Whenever starting a new animation clip of this track, SkeletonAnimation.UnscaledTime or SkeletonGraphic.UnscaledTime will be set to this value. This allows you to play back Timeline clips either in normal game time or unscaled game time. Note that PlayableDirector.UpdateMethod is ignored and replaced by this property, which allows more fine-granular control per Timeline track.

New 4.1-beta timeline UPM packages are available for download:
Spine Unity Download

We also discovered and fixed a bug with SkeletonGraphic Track and clips that have Default Mix Duration disabled:
https://github.com/EsotericSoftware/spine-runtimes/issues/2090
This issue has been fixed on both 4.0 and 4.1-beta branches, new UPM packages are available.