0
0
Unityframework~10 mins

Blend trees in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
ABlendTree
BRunWalkBlend
C"RunWalkBlend"
D"BlendTree"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the name string.
Using the class name instead of a string.
2fill in blank
medium

Complete 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'
AblendParam
BblendParameterName
Cparameter
DblendParameter
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names like blendParameterName or parameter.
3fill in blank
hard

Fix 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'
AAddMotion
BAddChildMotion
CAddChild
DAddChildMotion2D
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like AddChild or AddChildMotion.
4fill in blank
hard

Fill 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'
Ais2D
BblendParameterY
CblendParameters
DblendParameter
Attempts:
3 left
💡 Hint
Common Mistakes
Using is2D or isTwoDimensional (non-existent or read-only).
Using blendParameters (which does not exist).
5fill in blank
hard

Fill 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'
ArunClip
B0.0f
CwalkClip
D1.0f
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of motions and thresholds.
Using incorrect threshold values.