Mecanim users, are you using root motion?

I’m curious how many people actually use the root motion mecanim feature.

Feel free to give your reasons for or against.

Been wondering which approach to take - to use root motion will require building animations that have it … Many of the ones I have don’t have it

Unless you’re doing a very specific humanoid only thing that requires very specific matching to nearby geometry for instance, like climbing a ladder in a realistic game, you will have no use for it. I’m not sure why it’s a poll when it’s a tool for a very specific set of solutions. You know if you need it :slight_smile:

1 Like

I’m doing those exact kind of things in my game. Matching hands to ledges at the end of a jump etc. I’m not using root motion (or by extention the target matching). I’ve just writen my own code to do it using the IK targets and some maths.

I know this is bad, but I honestly don’t even know what root motion does. I tried checking and unchecking the option for my characters and it did nothing for me (or against me lol). So, on some of my models I’m using it without even knowing what it does, and on others it’s unchecked.

I havn’t taken the time to read up on what it’s supposed to do. I’m sure it affects performance in some manner but it’s not large enough to tell in my game.

I thought root motion was what allow mecanim state machines to transition from one state to another based on speed or other parameters you set up. Is that not the case?

Imagine that you’ve animated a character walking, and in the animation you’ve made them actually move away from their start position - if you played that on loop in game, then not only would they keep snapping back to the start, but they’d also be moving away from where their GameObject actually is.

Root Motion analyses the walk and moves the character’s GameObject to be in sync, such that both problems are solved.

Additionally, root motion makes it that the movement speed of your character is determined by the animation. This gives it a more realistic feel, as a natural walk or run gait doesn’t produce a constant speed. It also eliminates the foot sliding phenomenon that older games have.

But this also means it’s more difficult to rein in the character’s movement. If you’re making a strategy game and you need the character to move and stop at the exact spot you clicked, the code to do that is different from the usual, as you have to take into account that the character takes time slowing down their walk/run before coming to a complete stop.

I would actually love to do that but haven’t had the time to think exactly how to do it. I only recently got a Pro (from job) and haven’t had the time to play around with the Pro-only features.

1 Like

That is pretty interesting. Thanks for the info. Never really knew what it did till now then :slight_smile:

Root motion is great for walk loops that don’t keep the same speed throughout and other animations like limping etc. I prefer to use it myself. Saves the walking on ice situation. lol

I have implemented a physical character controller where the current speed is just forwarded to the animator. Overall the result is better in my opinion. If you are using root motion, the walking looks more realistic, that’s true, but as soon as you walk against a wall the situation changes.

Doesn’t have to only be humanoids though. For example, you can also use it to do stuff like in Half-Life 2 where a headcrab might appear, then climb up over some obstacles and into a vent in a scripted in-game cutscene. But yeah, the use cases are pretty specific.

Root motion is also used if you absolutely want animation to dictate gameplay with in-place foot planting. This is something I don’t really go for, as it does impact how the game feels. It’s graphics > gameplay instead of having a compromise of a tiny bit of slide nobody really notices anyway.

John Mac has an excellent tutorial series for mecanim and using root motion. He is recreating the movement from The Legend of Zelda: Wind Waker:

Root motion gives a very good feeling of “weight” into the controls, something western games didn’t used much. Assassin’s Creed is also a good example for “weight” in the animations.

Well for root-motion-based character systems, isn’t that done by changing the animation playback speed? That would effectively change the movement speed as well.

Also, how would one go about making such a thing work properly with a CharacterController? Since the proper way to move the CharacterController is via script i.e. Move method.

If you run against a wall, there will usually be a delay if you e.g. run against a wall and the animation will look ugly. It is comparable to an immediate stop, which is almost not achievable with the root motion.

If you call Move in the CharacterController, you also feed that value to the animator. Of course you have to convert it whatever the animator expects.

@AnomalusUndrdog , mecanim can handle CharacterController without writing a single line of script code.

The Animator detect when there is a CharacterController on the same gameobject and that you don’t override MonoBehaviour.OnAnimatorMove callback. In such case we do compute the velocity and send it directly to the CharacterController.

2 Likes