Character Rotation resets when enabling 'Use Controller Rotation Yaw' during play

I’ve set up a control system in which the Player uses an analogue stick, dpad or WASD to move around the world, with ‘Use Controller Rotation Yaw’ disabled by default. This is so that the player’s character will face the direction they are moving in. The player does not have any control over the camera.

I also have an ‘Aim’ button set. When this is held down, movement is stopped and the left and right input is used to rotate the character instead, via ‘Add Controller Yaw Input’ (see pic #1).

To do this, I have to set ‘Use Controller Rotation Yaw’ to true when ‘Aim’ is held, and disable it again when 'Aim. is released. (see pic #2). I also disable ‘Orient Rotation to Movement’ whilst aiming.

Ingame, this exhibits some odd behaviour. The first time I enter aim mode, my character will automatically snap their Yaw to ‘0, regardless of where they were facing last’. I can rotate correctly using left and right, and when I exit ‘aim’, my character will remain facing in that direction. I can move around again, as expected,

Then, when I enter aim again, my character will snap to the rotation of where the previous aim ended. I would ideally like my character to keep their facing direction when they aim.

This looks like a bug to me as there isn’t a value I know of that accounts for this snapping. Is my method correct? I don’t think I should be forcing yaw movement through setting character rotation.

Also, enabling / disabling ‘Orient Rotation to Movement’ has no effect on this problem, either way - which apparently overrides ‘Use Controller Rotation Yaw’

I’d like to add that this bug goes back several versions - I aborted an attempt at this prior to 4.10 due to the same issue.

1 Like

You can use “Set Control Rotation” node in Player Controller Blueprint and pass Character rotation in new rotation

For anyone who encounters this problem, this is the solution.

Before turning on Orient Rotation to Movement you set a new Control Rotation. For this you also need to enable and disable Use Controller Desired Rotation as shown.

Essentially when Orient Rotation is ON, your Controller Rotation doesn’t update, so you need to do so before using it again.