0
0
Unityframework~20 mins

Blend trees in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Blend Tree Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this blend tree parameter evaluation?

Consider a 2D blend tree in Unity with parameters Speed and Direction. The blend tree blends between four animations: Idle, Walk, Run, and Strafe. Given the following parameter values, which animation will have the highest weight?

Speed = 0.7
Direction = 0.0
AWalk animation has the highest weight because Speed is between 0.5 and 1
BStrafe animation has the highest weight because Direction is 0
CIdle animation has the highest weight because Speed is less than 1
DRun animation has the highest weight because Speed is closer to 1
Attempts:
2 left
💡 Hint

Think about how blend trees interpolate between animations based on parameter values.

🧠 Conceptual
intermediate
1:30remaining
Which parameter type is best for smooth directional blending in a 2D blend tree?

In Unity's blend trees, you want to smoothly blend animations based on the character's movement direction on a flat plane. Which parameter type should you use?

AUse two float parameters representing X and Y components of direction
BUse a single float parameter representing angle in degrees
CUse a boolean parameter for left or right direction
DUse an integer parameter for discrete direction states
Attempts:
2 left
💡 Hint

Think about how 2D blend trees use parameters to blend smoothly in two directions.

🔧 Debug
advanced
2:00remaining
Why does the blend tree not blend animations smoothly?

You created a 1D blend tree with animations for Idle (0), Walk (0.5), and Run (1). However, when you set the parameter to 0.75, the animation snaps abruptly to Run instead of blending. What is the likely cause?

AThe parameter value 0.75 is out of range for the blend tree
BThe blend tree is set to discrete blending instead of continuous blending
CThe animations are not assigned correctly in the blend tree
DThe Animator Controller is not assigned to the character
Attempts:
2 left
💡 Hint

Check the blend tree's blending type settings.

📝 Syntax
advanced
1:30remaining
Identify the syntax error in this blend tree parameter setup code snippet

Look at this C# code snippet that sets parameters for a blend tree in Unity. Which line contains a syntax error?

animator.SetFloat("Speed", speed);
animator.SetFloat("Direction", direction)
animator.SetBool("IsRunning", isRunning);
Unity
animator.SetFloat("Speed", speed);
animator.SetFloat("Direction", direction)
animator.SetBool("IsRunning", isRunning);
ALine 1: Missing semicolon
BLine 3: Incorrect method name
CLine 2: Missing semicolon
DNo syntax errors
Attempts:
2 left
💡 Hint

Check each line carefully for punctuation.

🚀 Application
expert
2:00remaining
How many animations are blended in this 2D blend tree setup?

You have a 2D blend tree with parameters Horizontal and Vertical. The tree blends between these animations at these positions:

  • Idle at (0,0)
  • WalkForward at (0,1)
  • WalkBackward at (0,-1)
  • WalkRight at (1,0)
  • WalkLeft at (-1,0)
  • RunForward at (0,2)

How many animations are blended in this tree?

A4
B5
C7
D6
Attempts:
2 left
💡 Hint

Count each unique animation listed.