- Home /
Changing speed of running animation
How do I change the speed of a blend tree dynamically? I have a blend tree, and I have a speed parameter, yet i don't see any way to increase the speed of the animation. My blend tree is set up with a walking player, and a running player animation. I would like to be able to change the speed of the running player animation, based off of the value that is causing the blending between the two. Is there a way to do this other than by changing the speed of the entire animator?
I am using C# and this is in Unity 2D.
Answer by be9em0t · Jun 02, 2014 at 07:24 AM
To a large degree speed is specific to the motion (you can't turn a walking animation into a running animation just by changing speed).
So "the animator's way" to solve your question is to use a blend tree which blends Walk and Run depending on a Speed parameter. Unity's Mecanim is quite good at this.
In the example below, taken from Mocapi Motion Pack the Move parameter does what Speed would do in your case.