I’m working on getting a third person character to be able to fly and have 6DOF movement. So far, I’ve gotten past gimbal lock using quaternions and I can successfully get the character to roll left and right and get the camera to roll with them.
However, the problem comes when I try to move the character’s yaw and pitch using the look input, it seems that the look movement is tied to the world rotation.
The result is that the player rotates -90 and the goes along with it, so the view from the camera matches the rotation of the player.
However, seen by the world up and left lines, when I attempt to move the look input pitch and yaw, this movement is still tied to the ‘world’ rotations (which has not changed), instead of being tied to the player’s new rotation.
Any advice or direction to tutorials would be of great help! Thanks in advance!
Note: I’ve tried disabling Use Pawn Control Rotation right after disabling Inherit Roll. This results in fixing the camera movement issue, allowing the camera’s pitch and yaw to rotate with input, however the pitch and yaw of the character’s mesh now rotates with the world instead of locally, so fix one problem create another. I’m thinking the ultimate fix could be here, but I’m not seeing it so far.
Dont use character. Dont use pawn. Make your own controller. In c++.
And do not use tick. Not even for prototyping.
What else? Oh yea, if you need this to replicate on a server you need to expressly look into how it’s supposed to be done hint, you wont find any best practice way within unreal’s free to use templates.
Ha, and last but not least: don’t even think about trying to use the engine’s physics - unless you swap to physx, then mayne you can at least think about it.
Come to think of it, you may be better off getting the starting code from something like Gdot or similar. You can find full on phisically calculated “flying” controllers out there - it just depends on what exactly you need…
Are you trying to create a rotation like a starship? If so, I guess you can just try using nodes like Add Local Rotation. “Yaw” (Delta Rotation Z) can be used to locally rotate the camera left/right, “Pitch” (Delta Rotation Y) can be used to locally rotate the camera up/down. You can also use “Roll” (Delta Rotation X) to rotate around the longitudinal axis. I don’t think you need quaternions at all with this node.
You would in order to prevent gymbal locking, but if you do the math for your system and truncate the angle back to 0 when over 380 you can sometimes get around the issue.
Problem is, Pawn can do this OK (ish), The character class cannot.
And then there is also the possible lack of replication…