Character controls: To RootMotion or not to RootMotion?

This is something I’m always wondering about.

In a third person game, for instance, is it better to make the character’s movement governed by the animation’s root motion, or to make “in-place” animations and let the script handle the movement?

I tend to prefer the “no RootMotion” method because of the extra control it gives me, but it has the disadvantage of being difficult to actually sync with the animation’s motion.

What are your thoughts on this? Does anybody know of a good way to make the movement speed fit the animation perfectly when not using root motion?

Animation workflow has been one of my subjects of research for the past few years xD

Typically I’d say go with Script Controlled movement. Here’s why: Control. I tried Root Motion once and in order to change the speed of my character I had to go in and actually change animation bone keyframes. In scripting I can just change a variable. Furthermore, things became a mess with gravity and falling. I had to actually move the character down based off of keyframes in the root, which was extremely frustrating. In scripting you can just let the good old Physics.gravity do the work, or even better, CharacterMotor.

However, one advantage to root motion is that its easy to achieve inconsistent character movement. For example, a crawling animation could easily have the root move in increments, but in scripting you’d have to do much more complicated non-keyframed based movement. Finally, root motion won’t allow you to easily make character states. Scripting would allow you to easily move the character to desired cutscene locations or parent itself to objects. IK is also simpler in some ways because your animations can be relative instead of world dependent. Although I think root motion will do that automatically…

Also as for matching movement speed, I always make my animations at an even 30 or 60 frames. Then I set my Mecanim parameters according to actual speed, the actual inverse transform velocity of the motor, not the input. That way, animations placed in a BlendTree set to the velocity will always match up. Then I manually change the “speed” value for the animations in the BlendTree to match. Works even better because I can just use it twice and just change the speed to easily get extreme movement cases. And I know that double the velocity means double the animation speed.

Hope that gave some insight into animation workflow and root motion :slight_smile:

3 Likes

very helpful, thank you

1 Like