I have this camera pawn, i move it with WASD by adding and offset when keys are pressed, works fine until I rotate it, then W is no longer “up”, S no longed “down”, etc
My question is, how can I preserve those axes after adding a rotation to the actor?
@DEV7591 You’ll have made a mistake in you code for the rotation. It’s an easy mistake, because rotation just seems to be left/right or up/down, but once you get into it, you realize the vector can be pointing in any direction.
Best bet is to post your BP on the answerhub ( it’s a link on the marketplace menus ).
It’s code not BP, and what kind of error could I be doing there? It’s a single line.
Tried local and relative too, makes no difference.
If the rotations are ‘reversing’ so to speak it sounds like Gimbal Lock. If this is true have a quick search and you should find info on this. ‘Quaternions’ will be your answer here.
If I’ve misinterpreted your question post a bit more info and we’ll get to the bottom of it.
Sorry about the explanation it was probably poor, let me try with an image
https://forums.unrealengine.com/filedata/fetch?filedataid=170301&type=thumb
Without rotating camera movement works as expected (green arrows representing WASD), now let’s say I rotate it a bit, then if I press W it moves in the red arrow direction.
This is how I am rotating it
CameraPawn->SpringArm->AddRelativeRotation(FRotator(0, SomeFloat, 0));
figured it out