Download

setting Max/Min angle values for camera c++

Ok, so I’m trying to limit how much my first person camera can look up and down in c++. I tried to use the FMath::Clamp but that only made the camera shake like crazy going up and down by itself. I’m new to c++ so I’m trying to find the best way to limit the camera’s pitch.




void AYT_Character::LookUpAtRate(float value)
{
    
    AddControllerPitchInput(value * BaseLookUpAtRate * GetWorld()->GetDeltaSeconds());
}



Can try these:


playerController->PlayerCameraManager->ViewPitchMax
playerController->PlayerCameraManager->ViewPitchMin

There’s also Yaw and Roll versions of those variables.

Check out APlayerController::UpdateRotation() and APlayerCameraManager::ProcessViewRotation().