Rotating a top down camera in the Character Controller

Im trying to understand how to rotate the spring arm component in my character class, I tried implementing this using this code:

void AMyPlayerController::PanCamera()
{
USpringArmComponent* SpringArmRef = PlayerCharacter->SpringArm;

FRotator Rotator;
Rotator.Yaw = MouseAxis.X;
Rotator.Pitch = MouseAxis.Y;
Rotator *= PanSpeed;

SpringArmRef->AddWorldRotation(Rotator, false, Hit, ETeleportType::None);

}
I get the mouse axis by assigning the MouseAxis Vector2 the input values from a mouse input action. The issue I have is that whenever I move the mouse in a diagonal direction angle gets tilted like this: