HI! So I am trying to fix a Free look camera to my first person character.
How I want it to work is when I press ‘Left Alt’ and move on the mouse the camera should rotate in Yaw and Pitch but not in Roll.
How I am doing it atm, I added so I could cap Yaw & Pitch to a sertain radian and as you an see I am not adding anything to Roll. But it is affecting the Roll either way.
I can’t wrap my head around too well, but seeing as you’re programming I’m sure it will be easier. You want to work with quaternions. I believe the default rotation format is eulers. If I say anymore I might explode, good luck!
I am wondering if a character movement or camera setting is causing the issue:
// Don't rotate when the controller rotates. Let that just affect the camera.
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = false;
bUseControllerRotationRoll = false;
// Configure character movement
GetCharacterMovement()->bOrientRotationToMovement = true; // Character moves in the direction of input...
FollowCamera->bUsePawnControlRotation = false; // Camera does not rotate relative to arm
I move pawns about my scene with something a little more primitive with AddLocalRotation, so I know the below works (and modifies an attached camera):
ok, is the camera attached on the body, for example on the head if you wanted to do a first person camera?
Because my Camera is just loose and not attached. Its placed in the “Head” of my character.
So when I move my camera im not moving my character while holding down Left Alt.
That is only camera movement since I want to make a Free Look for my player.