I posted this in the forums but got nothing, so I’m hoping someone here can tell me what I’m doing wrong.
I’m having trouble rotating my character in a side-scroller. I’ve worked around this problem for a long time by applying yaw procedurally to my character (with CharacterMovementComponent:Use Controller Desired Rotation enabled), but now I’d really like to fix things so root motion through animation can take over (like all other movement is controlled in my game).
In my side-scroller the character moves in positive or negative X. I have an animation that rotates the root bone of the hierarchy 180 degrees around Z (I can verify this rotation is there in the animation viewer when I turn Root Motion off). I play this animation whenever I know my character needs to turn around. The rotation never seems to get applied to the character globally, so my character keeps turning on the spot and resetting to the direction they were facing at the start of the animation (as though I didn’t have root motion enabled, even though I definitely do). Translation is applied fine always.
There are 3 options that look relevant to me in CharacterMovementComponent:
- Orient Rotation To Movement
- Use Controller Desired Rotation
- Constrain to Plane (set to a plane in X)
In my procedural workaround I had all options set to true, and applying yaw would make the character rotate on the spot until they aligned with the required direction.
With my attempt at root motion rotation, no combination of the above options makes the character rotate with animation successfully.
It also appears that if I teleport the player with a new orientation, it doesn’t work in any case. Something is forcing my character’s orientation to be stuck and the only way to change it is by applying yaw.
Anyone know what I’m missing?