Camera Rotation Inverted

The Camera rotation is getting inverted when I try this,

FRotator Rotation = Controller->GetControlRotation();
FRotator NewRotation = FRotator(Rotation.Pitch + Value, Rotation.Yaw, Rotation.Roll);
Controller->SetControlRotation(NewRotation);

The Mouse Y input settings is at -1.0

The camera is not inverted when doing

AddControllerPitchInput(Value);

I checked the player controller class and it basically add’s the value to the pitch.

void APlayerController::AddPitchInput(float Val)
{
	RotationInput.Pitch += !IsLookInputIgnored() ? Val * InputPitchScale : 0.f;
}

Can someone explain why the camera is being inverted in the first case ?

I’ve tested the mouse Y to have negative values while moving the mouse upwards in both cases.

My only guess here is that in AddControllerPitchInput(), InputPitchScale is negative by default. Your implementation doesn’t take this into account.

I thought so too, I cant find where this InputPitchScale is being set to confirm it

Apparently it is -1.75 by default.

I just checked, it is set in the BaseInput.ini

I found it in BaseGame.ini, Thanks for the reply, cheers

1 Like