

You may notice that while blending between Walk and Run works well, the blending between Idle and Walk gives a much slower result than you might expect (the character barely moves at all when under 50% speed). This gives us a character who can move at any speed: For this example, we want to control it using a UI Slider so we need a public property (or method) for it: public float Speed This allows us to get and set that parameter using _. Note the new Parameter Name field which gives us a dropdown menu to select the name of any float parameter in the assigned Controller. SetFloat("Speed", value) to control it we can instead use a Float1ControllerTransition to wrap that parameter for us: In this case, the only thing in the Animator Controller is a Blend Tree controlled by a float parameter, so rather than hard coding the script to use. private ControllerTransition _Controller Public sealed class LinearBlendTreeLocomotion : MonoBehaviour Rather than using a RuntimeAnimatorController field to assign the Animator Controller and then creating a new ControllerState manually, we can just use a Transition (specifically a ControllerTransition) which will handle that all for us: using Animancer This example uses an Animator Controller containing a Blend Tree which blends between Idle, Walk, and Run animations:Ĭontroller States are used to play Animator Controllers inside Animancer. Animancer Lite allows you to try try out these features in the Unity Editor, but they are not available in runtime builds unless you purchase Animancer Pro.

Pro-Only Features are used in this example: Controller States and Mixer States. This example demonstrates how you can blend between Idle, Walk, and Run animations based on an arbitrary parameter to move the character at any desired speed using either a Blend Tree in a Controller State or a Mixer State as well as how Transition Assets allow you to share animation details throughout your project. Location: Assets/Plugins/Animancer/Examples/03 Locomotion/02 Linear Blending

Difficulty: Intermediate - Recommended after Quick Play
