Does anybody have some experience using root motion animation in games?
I want to test if a few of my assumptions are correct. I am using UE5 and multiplayer is not a consideration here. I have tested root motion for a third person player controller and decided that it was better to use in-place animation for that.
The reason for that decision were mostly because I'll be making many fine adjustments to player speed / agility. Easier to just change numbers compared to retime animations.
But for AI characters, it seems like there could be a few key benefits.
But what you lose is similar with the player controller. That is, lets say I want to globally adjust enemies speed. If they all use root motion animations, that simply is not possible, right? I'd have to retime every animation manually?
If that is true then root motion is pretty much a no-go. I prefer to have data entry such that AI speed is set as a percentage of player speed. So if I decide that player should move faster and change that, all AI speed matches it. That wouldn't work if I have to adjust speed per animation.
So, major considerations in order of priority:
Of course this is testable, but I didn't have a ton of confidence that I was doing things exactly correct when working with root motion previously, so figure I'd poll the audience to get an idea if I'm at least in right ballpark or not.
Replies
Why not both? I'd recommend most animation to be done as in-place. Calculating offsets with baked-in motion of the root gets really complex.
If you need a lurch animation with in-place, you could calculate the animation offset of the new ground position and reverse-transform to get the new root position for the next animation. Keeping it essentially in-place motion.
Thanks for the reply @Eric Chadwick ,
I am not sure I understand exactly.
Do you mean that the animation is authored with root motion, meaning any forward/backward or left/right locomotion comes from that root bone. An example is like this:
If I remove keys from the root bone for this animation, the jump will no long make the model actually move forward. It becomes in-place animation.
So if I understand correctly, the animations could still be authored with root motion, but in unreal the root motion could be disabled, and then through code we can identify the difference between where the root is compared to the center of the character… actually now that I type this out, it's not making sense so I must be completely lost.
I guess it might be better to ask, what do you mean by "animation offset" and "new ground position"? If the animation arrives to the engine as in place, the engine has no way of knowing what the intended locomotion is meant to be? In other words, if I want the jump to go five feet, or five thousand, there is no way to determine that programmatically, right? It would just have to be hard-coded in per animation?
Ask yourself: How will your satyr character play its next animation, after finishing the jump?
If the offset is baked into the jump animation, the root is still where it started, back at the launching point. Which means the next animation will snap the satyr back.
In-place animation is probably the better way. It would not move forward in the animation. Your root node would need to be moved to where you want the character to land, so the next animation starts from there.