Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new Blend Tree in an Animator Controller.
Unity
BlendTree blendTree = new BlendTree();
blendTree.name = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the name string.
Using the class name instead of a string.
✗ Incorrect
The name property requires a string, so it must be enclosed in quotes.
2fill in blank
mediumComplete the code to set the blend parameter of the Blend Tree.
Unity
blendTree.[1] = "Speed";
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names like blendParameterName or parameter.
✗ Incorrect
The correct property to set the blend parameter is blendParameter.
3fill in blank
hardFix the error in adding a child motion to the Blend Tree.
Unity
blendTree.[1](new ChildMotion { motion = walkClip, threshold = 0.5f });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like AddChild or AddChildMotion.
✗ Incorrect
The correct method to add a motion to a Blend Tree is AddMotion.
4fill in blank
hardFill both blanks to create a 2D Blend Tree and set its blend parameters.
Unity
BlendTree blendTree = new BlendTree(); blendTree.[1] = "Speed"; blendTree.[2] = "Direction";
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using is2D or isTwoDimensional (non-existent or read-only).
Using blendParameters (which does not exist).
✗ Incorrect
blendParameter is used for the primary (X) blend parameter, and blendParameterY for the secondary (Y) parameter in 2D Blend Trees.
5fill in blank
hardFill all three blanks to create a Blend Tree with child motions and set thresholds.
Unity
BlendTree blendTree = new BlendTree(); blendTree.blendParameter = "Speed"; blendTree.AddMotion(new ChildMotion { motion = [1], threshold = [2] }); blendTree.AddMotion(new ChildMotion { motion = [3], threshold = 1.0f });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of motions and thresholds.
Using incorrect threshold values.
✗ Incorrect
The first motion is walkClip with threshold 0.0f, the second is runClip with threshold 1.0f.