• Unity
  • Change animation speed when using SkeletonMecanim

Hello!

I am starting to use the Spine in unity, and I'm trying to acelerate or slow an animation. I've already tried to change the "Speed" in the Animator window but nothing changes. So, searching in this forum I found a tutorial about changing the timeScale by doing that:

SetAnimation(0, "animation", true).timeScale = 0.5f;

But, I cannot find any SetAnimation method in the SkeletonMecanim which is the instance I'm using.
So my question is, how do I change the timeScale of a animation when using SkeletonMecanim?

Related Discussions
...

Sorry for the trouble, unfortunately only fixed Speed parameters are supported for now.

We have an issue ticket here that deals with supporting normalized time in the SpineMecanim component: https://github.com/EsotericSoftware/spine-runtimes/issues/1417
Here is the respective forum thread:
Request: SkeletonMecanim Normalized Time Control

What you could do as a pretty good workaround in the meantime is to create a BlendTree state that uses the same animation clip twice, one with Speed 1 and one with Speed 2 and blend between them using your speed parameter.


After testing this in unity 2019.3 and 2018.4, strangely it now worked out of the box. Both setting the Speed parameter via the Inspector value during playback, and also binding an Animator multiplier parameter to it - the animation changed speed as desired during playback.

Could you please let us know which Unity version you are using?

I'm using Unity 2019.3. I've tried this trick with BlendTree, but the speed hasn't changed.

Which version of the spine-unity runtime (name of the unitypackage) are you using?