What is Root Motion and How to Set It Up?

This is a very common question we get a lot in game development - what is Root Motion?

Root Motion is simply the “root” bone of a skeleton structure that is animated to move the character/object through the 3D world.

You can think of it as drawing an invisible point down under your own center of gravity (vertically down from your hips) which is always there and when you move it moves, this is what we animate to achieve the Root Motion.

A basic structure setup to use Root Motion would look like this:

root_examples

There are many ways to animate the root bone in a way that is suitable for game engines to interpret.

One of the main things to look out for is the Game Engine’s coordinate space.

Unreal Engine and Unity, the two most popular game engines use different coordinate spaces, which make cross-development for assets slightly more tricky.

unnamed

To develop these Root Motion assets, I use Motionbuilder which provides the most freedom in editing and creating constraints to handle cross-development more efficiently.

For this tutorial let’s create Root Motion for an Unreal Engine animation. (Using Unreal Mannequin)

To set up the root bone for Unreal Engine development in Motionbuilder I would first set the Degrees of Freedom attribute for the root bone to use Rotation DOF (Degrees of Freedom).

I would then set a pre-rotation in the X field of -90.

This will align the vertical Y-axis in Motionbuilder to the correct axis in Unreal Engine for Y horizontal on the ground. You can see the green Y-axis now laying down correctly for Unreal Engine use in this picture.

There are a couple more things we need to do now. You may notice when you bring in motion capture data the root bone doesn’t move, we need to constrain it to the hips.

Again in Motionbuilder, we will continue editing the root bone.

We will first create a Translation DOF, enabling the Enable Min Y button which will limit the -Y movement, this will stop our root bone from going through the floor.

Next, we will set up a rotation constraint - this will handle getting the rotation from our hips down to the root bone correctly, we do this via a Rotation Constraint. You can find these constraints in the Asset Browser -> Constraints. Drag the root bone into the constrained object and the hips/pelvis bone into the source.

This will transfer the rotation of the hips to the root bone.

But, uh oh! There’s a problem.

You’ll notice if the character bends over so does the root bone, this is due to all the rotation values being copied to the root bone, not good! We’ll need to set up a new degree of freedom.

Let’s go back to the root bones Degrees of Freedom and opening the Min R and Max R pullouts. We will select Enable Min X, Enable Min Y, Enable Max X, Enable Max Y. This will allow the root bone to calculate the correct rotation from the hips/pelvis bone.

This looks much better.

Now we need to set up a Relation Constraint to move the root bone correctly under the hips/pelvis bone.

Okay, we need to drag a new Relation Constraint from the Asset Browser onto the root bone. You should see this constraint node graph appear. If not double click the Relation Constraint highlighted blue in the picture.

Now drag the hips/pelvis bone onto the node graph. You will see that it has 3 outputs. Under the Converters box, expand it and pull out a Vector to Number converter, this will separate the Vector3 into 3 floats. Now drag a new Number to Vector converter out as well.

Connect the graph as I have, from the hips/pelvis Translation to the Vector which we then connect just the X to X and Z to Z leaving the Y alone (right mouse click the Number to Vector Y to set a value of 0) and final the resulting vector from Number to Vector to the root bone Translation. Done.

Now we need to set up a character extension for our character. I won’t cover the human-ik character setup here, as it’s fairly straight forward, I can do another tutorial if anyone wants info on that. Just make sure you have a characterized character ready to go.

Now in the Asset Browser again, go the Characters panel and drag a new Character Extension and drop it on your Character. You should see this now.

extension

Now drag your root bone onto the Character Extension and add it to the Character Extension.

Perfect, now make sure in the Character Extension properties it’s set to your Character (sometimes it doesn’t connect properly).

You’re done! Now when you bake from either Skeleton to Control Rig or Control Rig to Skeleton it will also bake the root bone - this creates the Root Motion.

In the next advanced tutorial, I’ll show you how to manipulate the baked root motion data into precise direction driven motions. (Useful for turn-in-places and directional starts and stops.)

If you have any root motion tips that you have found, please feel free to share them here :grinning:

Thanks for checking out this tutorial, if you are interested in a sample scene that is setup, let me know here :+1:t3: