Simple project where the player is a ship and I want the player to be able to move on all axis and rotate in a zero g environment. (This all works)
The problem is once the player is upside down all the controls get wonky.
I have wasd setup to take the camera’s vectors. And it seems to work but my mouse get’s inverted as it is tied to the world. Somehow I need the mouse movement to be relative to the pawn’s rotation that way when you look right it will always be right, relative yo your rotation. But now if I look right while upside down I’m looking left to the pawn but right to the world(if that makes sense).
As the player has complete freedom of movement: forwards/back, left/right, up/down, rotate left/right. And it is quite disorienting to try to shoot and move or maneuver when all the sudden the movement isn’t relative to you when it appears that way when your rotation is “normal”.
Any help appreciated. Thanc.
Edit: Trying to think of a better way to explain the character should always have the front of the ship on screen like in cod when you always have your characters hands and gun in view. When you move, roll or anything; the character’s hands and gun would always be bottom center of your screen no matter what. With this in mind wasd should always move the same and the mouse look should always be the same, as should the ascend/descend functions I have for my ship.
Everything works fine if the character is not rotated, but, again; the controller doesn’t take the pawns rotation into account so when you start to rotate the controls get messed up and will invert once you’re over a rotation threshold. This isn’t what should happen. I need some sort of way to force the players controller to take the pawns world rotation into account so it will always be the same movement no matter where or how you are in a zero-g environment.
And I guess a smaller issue if the player is rotated 90 any way. The ascend/descend functions break hard. Just think of it as a jump/crouch. When the player is rotated these controls break because “left” to the player may mean going into the air or vice versa, when the world isn’t getting rotated so the up/down sill takes you up down relative to the world not you.
Thanc again, any help appreciated.
Edit: It seems from my understanding this is a result of “gimbal lock” I am trying to figure out anyways around this but it seems quite silly that quats aren’t already exposed to bps and you should be able to set a pawns rotation axis regardless anyways… Why is everything force aligned to world?