I want to limit the pitch of the Player camera, which is connected to the spring arm attached to the player capsule.
I want to do this in C++ rather than Blueprints.
Does anyone know how to implement this in C++ for the Unreal Engines?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI want to limit the pitch of the Player camera, which is connected to the spring arm attached to the player capsule.
I want to do this in C++ rather than Blueprints.
Does anyone know how to implement this in C++ for the Unreal Engines?
I rephrased my question in several ways and came up with a solution which I would lie to share.
In BeginPlay of the PlayerController add the code below.
APlayerController* ShooterPlayerController = Cast<APlayerController>( Controller );
if ( ShooterPlayerController )
{
if ( ShooterPlayerController->PlayerCameraManager )
{
ShooterPlayerController->PlayerCameraManager->ViewPitchMin = -45.0;
ShooterPlayerController->PlayerCameraManager->ViewPitchMax = 45.0;
}
}