Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is root motion in Unity animations?
Root motion means the character's movement is driven by the animation itself, not by code. The animation moves the character's position and rotation in the game world.
Click to reveal answer
beginner
How do you enable root motion on an Animator component?
You check the Apply Root Motion box on the Animator component. This tells Unity to use the animation's movement to move the character.
Click to reveal answer
beginner
What happens if Apply Root Motion is disabled?
The character will not move based on the animation. Instead, you must move the character using scripts or physics.
Click to reveal answer
intermediate
Why use root motion instead of moving the character by script?
Root motion makes movement match the animation perfectly. It helps avoid sliding feet and makes animations look natural.
Click to reveal answer
intermediate
What is a common problem when using root motion and how to fix it?
Sometimes the character moves too fast or in the wrong direction. You can fix this by adjusting the animation's root transform or using Animator.deltaPosition in scripts.
Click to reveal answer
What does enabling Apply Root Motion do in Unity?
AMoves the character using animation data
BDisables all animations
CMakes the character invisible
DLocks the character in place
✗ Incorrect
Enabling Apply Root Motion makes Unity move the character based on the animation's movement.
If root motion is off, how do you move the character?
ABy changing animation clips
BUsing scripts or physics
CBy enabling root motion
DAutomatically by Unity
✗ Incorrect
Without root motion, you must move the character manually with scripts or physics.
What problem does root motion help solve?
AFoot sliding during movement
BChanging animation speed
CChanging character color
DAdding sound effects
✗ Incorrect
Root motion helps prevent foot sliding by matching movement to the animation.
Where do you find the Apply Root Motion option?
APhysics settings
BCamera settings
CAnimator component
DLighting settings
✗ Incorrect
The Apply Root Motion checkbox is on the Animator component.
What can you use to adjust root motion movement in code?
A<code>Time.deltaTime</code>
B<code>Camera.main</code>
C<code>Physics.gravity</code>
D<code>Animator.deltaPosition</code>
✗ Incorrect
Animator.deltaPosition gives the movement from root motion each frame and can be adjusted in scripts.
Explain what root motion is and why it is useful in Unity animations.
Think about how animations can move characters without extra code.
You got /3 concepts.
Describe how to enable root motion and what happens if it is disabled.
Consider the Animator component settings.
You got /3 concepts.
Practice
(1/5)
1. What does enabling applyRootMotion on an Animator component do in Unity?
easy
A. It resets the character's position to the origin every frame.
B. It lets the animation control the character's movement automatically.
C. It makes the character move only by script, ignoring animations.
D. It disables all animations on the character.
Solution
Step 1: Understand the role of applyRootMotion
Setting applyRootMotion to true allows the animation's movement data to move the character automatically.
Step 2: Compare with other options
Other options describe disabling animations or ignoring root motion, which is incorrect.
Final Answer:
It lets the animation control the character's movement automatically. -> Option B
Quick Check:
applyRootMotion true = animation controls movement [OK]
Hint: Remember: applyRootMotion true means animation moves character [OK]
Common Mistakes:
Thinking applyRootMotion disables animations
Confusing root motion with scripted movement
Assuming it resets position every frame
2. Which of the following is the correct way to enable root motion in a Unity Animator component via script?
easy
A. animator.applyRootMotion = true;
B. animator.rootMotion = true;
C. animator.enableRootMotion(true);
D. animator.setRootMotion(true);
Solution
Step 1: Recall the correct property name
The Animator component uses the property applyRootMotion to enable root motion.
Step 2: Check syntax correctness
Only animator.applyRootMotion = true; is valid C# syntax and correct property usage.
Final Answer:
animator.applyRootMotion = true; -> Option A
Quick Check:
Correct property = applyRootMotion [OK]
Hint: Use applyRootMotion property exactly as named [OK]
Common Mistakes:
Using incorrect property names like rootMotion
Trying to call methods instead of setting properties
Syntax errors like missing semicolons
3. Given this code snippet in a Unity script attached to a character:
But the character does not move as expected. What is the likely problem?
medium
A. The Animator's applyRootMotion property is not enabled.
B. OnAnimatorMove should not be used for root motion.
C. You must call base.OnAnimatorMove() inside the method.
D. The transform cannot be set inside OnAnimatorMove.
Solution
Step 1: Check root motion enabling
Root motion only works if applyRootMotion is true on the Animator component.
Step 2: Understand OnAnimatorMove usage
Using OnAnimatorMove to override root motion is valid, but it requires applyRootMotion enabled.
Final Answer:
The Animator's applyRootMotion property is not enabled. -> Option A
Quick Check:
applyRootMotion must be true for root motion [OK]
Hint: Always enable applyRootMotion to use root motion overrides [OK]
Common Mistakes:
Forgetting to enable applyRootMotion
Thinking base.OnAnimatorMove() is required
Believing transform can't be set in OnAnimatorMove
5. You want your character to move with root motion but only apply horizontal movement from the animation, while controlling vertical movement via physics (gravity). How should you modify OnAnimatorMove to achieve this?
hard
A. Set transform.position to animator.rootPosition but keep transform.position.y unchanged.
B. Set transform.position to animator.rootPosition and ignore vertical velocity.
C. Set transform.position to animator.rootPosition and add vertical velocity manually.
D. Do not override OnAnimatorMove; use applyRootMotion only.
Solution
Step 1: Understand the goal
You want horizontal movement from root motion but vertical movement controlled by physics (like gravity velocity).
Step 2: Combine root motion with vertical velocity
Override OnAnimatorMove to set horizontal position from root motion and add vertical velocity manually to Y position.
Step 3: Choose the correct approach
Set transform.position to animator.rootPosition and add vertical velocity manually. describes adding vertical velocity manually, which matches the goal.
Final Answer:
Set transform.position to animator.rootPosition and add vertical velocity manually. -> Option C