I have bound my Camera Wheel Up & Down action mappings to these functions:
void ADefaultPlayerController::OnSetCameraZoomInPressed()
{
AMainCharacter* character = Cast<AMainCharacter>(GetPawn());
if (character != nullptr)
{
CameraZoomCurrent = FMath::Clamp(CameraZoomCurrent - CameraZoomFactor, CameraZoomMinimum, CameraZoomMaximum);
character->UpdateCameraBoomLength(FMath::FInterpTo(character->GetCameraBoomLength(),
CameraZoomCurrent, GetWorld()->GetDeltaSeconds(), CameraZoomSpeed));
}
}
void ADefaultPlayerController::OnSetCameraZoomOutPressed()
{
AMainCharacter* character = Cast<AMainCharacter>(GetPawn());
if (character != nullptr)
{
CameraZoomCurrent = FMath::Clamp(CameraZoomCurrent + CameraZoomFactor, CameraZoomMinimum, CameraZoomMaximum);
character->UpdateCameraBoomLength(FMath::FInterpTo(character->GetCameraBoomLength(),
CameraZoomCurrent, GetWorld()->GetDeltaSeconds(), CameraZoomSpeed));
}
}
No matter what values I set for CameraZoomFactor
(how much the camera zooms per mouse wheel scroll “notch”) and CameraZoomSpeed
, the zoom is still really choppy and not at all what I’m looking for.
Any ideas what is wrong and why my zoom isn’t “smooth”?
Thanks!