Blend Trees - Unity Official Tutorials

Unity · 262K views · 2014 · 8:04

Open on YouTube

Game programming & enginesIndie game developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering Unity animation questions about too many state machine transitions or jerky transitions, as a quick introduction to blend trees.

Recommended by 3 people across 3 different months, 2016 to 2018.

What it is

An 8-minute official Unity tutorial that explains blend trees in the Animator, which mix several animations together using parameters to get smooth, custom results. It is part of Unity's beginner animation learning module and is presented by Unity.

What people said

Recommends Anas iqbal · 2016-08 · Stack Overflow · on “How prevent large amount of transitions in unity state machine?”

As @Uri Popov said, you should consider using "Blend Trees". They are there for the same purpose. The help blend between multiple similar animations. for example, walk and run animation are similar in a way that they depend on character's movement speed. Look at the following links to learn more about blend trees. These are only basic but will surely help you with your problem. Unity - Manual: Blend Trees [LINK] Blend Trees - Unity Official Tutorials [this video] When to use a blend tree vs state machine for animations [LINK] (just another question on gamedev.stackexchange)

Recommends ZayedUpal · 2018-03 · Stack Overflow · on “Setting float for blend tree?”

You can take the horizontal speed of the CharacterController and assign it to the blend tree float value like this: public CharacterController controller; Vector3 horizontalVelocity = controller.velocity; float horizontalSpeed; void Update() { if(isPushing){ controller.setBool("isPushing",true); horizontalVelocity = new Vector3(controller.velocity.x, 0, controller.velocity.z); horizontalSpeed = horizontalVelocity.magnitude; controller.setFloat("speedPercentPush",horizontalSpeed ); }else{ controller.setFloat("speedPercentPush",0); controller.setBool("isPushing",false); } } Also, first check around what horizontal speed, you want to make the transition from idlePushAnimation to walkingPushAnim

Recommends Bagdan Imr · 2018-07 · Stack Overflow · on “Why when changing transition between two states in animator it's not changing it slow and smooth?”

Documentation claims that A transition from one motion to a completely different motion is usually fine if the transition is quick. But transition from "Walk" to "Use" probably requires using Blend Trees [LINK] to make it smooth. This video [this video] can be helpful. Good luck!