Lesson 4 · Essential
Root motion
Who moves the character: gameplay or the animation? In-place animation on a capsule that gameplay drives, root motion taken out of the clip, and what happens when it is taken out of neither. Drift, sliding feet and the snap, play-rate warping, and where motion matching fits.
A walking character is two things that both want to move: a capsule, which gameplay and physics push around, collide and query, and a mesh, which the animation poses. Every engine has to decide which one leads. The choice shapes how responsive the character feels, whether its feet slide, and whether it ends up where the designer meant.
Three ways to move a character
The character here follows one scripted course on flat ground: speed up to a walk, run, slow back to a walk, stop. Gameplay means to stop at the flag. The blend is the speed blend space with sync markers.
Loading…
It starts In place. Watch the feet as the speed changes, and the gap between the capsule and the dashed line in the other modes.
In place. The clip has its travel taken out: the root stays put and the feet move back under it, as on a treadmill. The character controller moves the capsule at whatever speed gameplay chooses, and the animation plays on top. Gameplay is exact and responsive: the capsule ends exactly where gameplay wants. But wherever the blend’s stride doesn’t match the capsule’s speed, the feet slide: 4.0 cm per metre over the course.
In place, play rate warped. The same, with the animation’s play rate scaled so its stride matches the capsule’s speed, within limits (here ½× to 2×; much further and the cycle visibly races or crawls). It fixes steady movement, but not starting and stopping from idle, where there’s no stride to scale: over the course it slides 7.1 cm per metre, more than plain in place. Engines pair it with stride warping, which lengthens or shortens the steps themselves with IK.
Root motion. The travel stays in the clip. Each frame the engine takes the root’s movement out of the pose and applies it to the capsule instead, so the body moves exactly as the animation does and the feet stay planted: 3.6 cm per metre, what’s left being the blend itself. The price is control. The character goes where the animation goes: between two samples a blend travels slower than the speed asked for (2.21 m/s for 2.40), so over this course it stops 0.36 m short of where gameplay meant to stop.
// Root motion, each animation update:
Transform before = sample_root(clip, t), after = sample_root(clip, t + dt);
Transform delta = inverse(before) * after; // how far the root moved this frame, in its own space
pose.root = Transform::identity(); // take it out of the pose...
character.move(character.rotation * delta.translation, dt); // ...and give it to the controller, which collides
character.rotate(delta.rotation);
The controller still collides and slides along walls; root motion only proposes the move. Unity calls this the root transform (Bake Into Pose keeps parts of it in the pose instead); Unreal extracts it per animation and per Animation Blueprint, with modes from “no root motion extraction” to “root motion from everything”.
Neither: drift and snap
Pick Root motion not extracted. The clips still have their travel in them and nothing takes it out, while the capsule moves at the gameplay speed as if they were in place. The mesh walks away from its capsule and, when the cycle loops and the root bone jumps back to its start, snaps back to it: here the mesh gets up to 2.40 m ahead and jumps back 2.33 m at a loop. Unreal’s root motion page shows the same drift and snap. If you see a character pop backwards once a cycle, or drift off its collision, this is the first thing to check.
Choosing
Games mix the two, per state:
- Steady locomotion in place, with play-rate warping and stride warping, because players expect the stick to be obeyed exactly and networked movement wants gameplay in charge.
- Starts, stops, turns, attacks, vaults and climbs with root motion, because the feet and the contact points matter more than the exact distance, and designers place things around the animation’s known travel.
- Root-motion-like control in between: drive the capsule from gameplay but read the animation’s speed and turn rate as a hint, or warp the clip’s root motion to land on a target (Unreal’s motion warping does this for vaults and mantles).
Beyond blend trees
Everything so far is hand-built: clips placed in blend spaces, states and transitions wired by hand. Two lines of work replace that wiring with data.
Motion graphs (Kovar, Gleicher and Pighin, SIGGRAPH 2002) build the transition graph automatically: find frames in a motion capture database similar enough to blend between, and generate motion by walking the graph.
Motion matching drops the graph. Simon Clavet’s GDC 2016 talk (Ubisoft Montreal) describes it: keep long, lightly marked-up capture takes, and keep searching them for the frame that best matches the current pose and the path the player wants next, then blend (or inertialize) to it. The result looks close to raw capture while still answering the stick. It needs a lot of data and memory, which Holden and colleagues’ learned motion matching (SIGGRAPH 2020) shrinks with small neural networks.
None of it removes what this section covered. Poses are still blended local transforms, switches are inertialized, feet are planted with IK, and the question of whether gameplay or the animation moves the character still has to be answered.
Takeaways
- In place: gameplay moves the capsule exactly; feet slide wherever the stride doesn’t match the speed. Warping the play rate helps while moving, not starting and stopping.
- Root motion: take the root’s movement out of the pose and give it to the controller. Feet stay planted; the character goes where the animation goes.
- Neither: the mesh drifts off its capsule and snaps back every loop.
- Mix them per state: in place for steady locomotion, root motion for starts, stops and actions.
- Motion matching searches data instead of following a hand-built graph, but the same pieces sit underneath.
In the lab
The lab’s root-motion view runs this course over flat ground, a ramp with steps, or rough ground, with foot placement on or off, in all four modes.
Open root motion on rough ground in the animation lab →
Further reading
- Unity documentation, How root motion works: body and root transforms, and what Bake Into Pose keeps in the pose.
- Unreal Engine documentation, Root Motion: the extraction modes, and the mesh leaving its capsule without them.
- Lucas Kovar, Michael Gleicher and Frédéric Pighin, Motion Graphs (SIGGRAPH 2002).
- Simon Clavet, Motion Matching and The Road to Next-Gen Animation (GDC 2016).
- Daniel Holden, Oussama Kanoun, Maksym Perepichka and Tiberiu Popa, Learned Motion Matching (SIGGRAPH 2020).