I’m working on an 6dof multiplayer game and I’m having trouble getting the character class to play along.
I have an aircraft that can apply pitch/yaw/ and roll using the addController* nodes, and i’ve disconnected the roll from the camera so that the aircraft is free to roll independently of the camera.
The problem I am running into is that I would look the addController Pitch and yaw to be applied relative the the current roll of the aircraft. See the following picture to show the problem when the aircraft is rolled 90 degrees
The Character uses pitch/yaw/roll from the controller while the camera does not inherit roll. I have a custom camera manager that I’ve just modified the limits of yaw/pitch/roll on to allow full range of movement.
Any thoughts? or am I barking up the wrong tree on how to implement this behavior?
I am assuming you are rotating your craft inside the capsule, as the capsule is Z locked and can’t flip around (if not I would like how you are doing that), the issue you are having is with that capsule is the indicator on the characters orientation so as long as that is up and down your pitch will still calculate it up and down in terms with addControler Pitch.
What I have done is use add rotation to the mesh in local space and also calculate the velocity direction also from the mesh. The gotcha I found with this method is that if you are using blueprints they don’t calculate FQuats so you will run into Gimble lock at the poles still. I use C++ but what you can do is create a uProperty node to make the calculation.
As you mentioned this as a Multiplayer game you will need to replicate the rotations up to the server manually.
Finally just a heads up my implementation is for a Space Sim so I don’t have to worry about true physics.