Root motion initial rotation?

Hi,

Is there any way to offset the initial rotation of an animation if root motion is enabled? My attempts have made no difference and my animation is always oriented the same by default.

This is for an enemy character and the animation will be played via montage (attacks, blocks, etc.)

What I’ve tried:
・Rotating the root and setting a keyframe on frame 0
・Changing “Root Motion Root Lock” between the different options
・Adjusting the “Import Rotation” and re-importing the animation
・Rotating the root in a different program (Blender/3ds Max) and re-importing it

No matter what I do, if root motion is enabled, the animation always faces the same direction. I can sort of get around this by changing the “Root Motion Root Lock” to “Anim First Frame” but then my character is no longer centered.

Ideally, I’d like to offset the initial rotation in-engine so I can quickly iterate. Is there any way to do this? Am I missing something?

Thanks for your time.

I’m guessing that there’s a reason here that just rotating the actual actor that’s playing the animation won’t work? The fact that you mention “then my character is no longer centered”, at least, suggests to me that the character is starting offset from the origin point, and thus that rotating the actor would rotate the character around that central pivot point (changing their position) versus just rotating the character in place.

I admit, though, I’m having a lot of trouble visualizing the specific scenario.

Are you trying to just change the rotation the character has relative to the rest of the animation? I.e., they start left of the origin, facing left, and you want them to start left of the origin but facing forward, and change none of the rest of the animation? Is the change meant to be universal? You mention changing stuff at import, so I assume so; i.e. the rotation isn’t dependent on anything at runtime, so you want to make one specific change and have that change be the case for every single use of that animation?

If so, I’d say “just redo the beginning of the animation to have the character facing the correct direction in whatever your animation tool was, export the new animation with the change you want, and then re-import it.” Changing the animation you import strikes me as being far less hassle than trying to import an incorrect animation and tweak it at runtime.

But again, I’m not 100% clear from your description on what you’re specifically trying to do.

The above might not apply in your scenario. Maybe you’re trying to change the rotation situationally (i.e. the character could start left of the origin facing left, or left of the origin facing backwards, or whatever, but would always play the rest of the animation the same); in that case, I think you’d have less headache if you just split the animation in two. Have one animation that rotated them to whatever orientation you wanted (or even just manually rotate them), and then play the second animation when they’re in an appropriate position for that animation to play. Etc.

tl;dr: Magic 8-ball says “Situation unclear, ask again.”

Hey Packetdancer, thanks for the reply!

I’m importing about 1,000 mocap animations with the root motion animated correctly. However, the character stands in different places relative to his center and is also facing in different directions (sometimes subtly, sometimes dramatically).

The positional offset is fine because when I enable root motion, it centers the character in the animation. The rotational offset is a problem because when I try to blend in and out of these animations, the rotation changes. He’ll go from facing me to facing some other direction (the animations are for an enemy AI).

I’d like to offset that initial rotation in-engine so I can quickly iterate through the 1,000 animations, matching their foot placement and checking them against each other in a level (by placing them all in the same location and then aligning their forward foot).

I may be able to do this in another program (albeit with more hassle) but exporting the animation and adjusting the initial rotation in 3ds max, then re-importing it in Unreal Engine did not make any difference. The characters still face in the original offset direction they faced when I first imported them. As if my change in 3ds max made no difference. Just like my change in the animation in-engine (setting a keyframe for root on frame 0 with rotation offset) made no difference.

My only solution now is to have the person who re-targeted the mocap do the rotations himself, but we may not have time to keep going back and forth making small changes if they come up (deadlines).

Have you found a solution to this problem?

image
RotateRootMotion

You could try setting ‘Allow Physics Rotation during Anim Root Motion’. Not sure if its the solution but i hope it helps anyone with a similar issue.