Calculating Pitch and Yaw offsets based upon roll

I’m working on a 6DOF player character and it’s going fairly well, save for the rotation.Using angular impulse is very smooth, but it ends up with lovely desync. So I’ve gone back to the player controller rotation as player location accuracy is important.

I’ve dealt with gimbal lock already using a Player Camera Manager

However well using Add Controller Pitch/Yaw/Roll may work for network replication, I have that lovely problem in which pitch and yaw work perfectly fine, unless you’re rolled 90 or 270 and then pitch becomes yaw and yaw becomes pitch. The player controller always rotates the pitch straight up and down no matter how the character is rotated and likewise with the yaw.

So to make a long story even longer; is there a blueprint or code based way that I can either calculate the proper amount of pitch or yaw to apply based on rotation, or is there a way to force the controller’s orientation to be relative to the character?

Turns out it wasn’t necessary. I got halfway through the math (it was starting to work) and discovered Quaternion solution to mouse look pitch and yaw - World Creation - Unreal Engine Forums in this post that all I needed to do was set the controller rotation manually after updating the actor rotation.

So now I have accurate transform replication and 6DOF control.

1 Like