diff --git a/Source/Blaster/Character/BlasterCharacter.cpp b/Source/Blaster/Character/BlasterCharacter.cpp index 08f0e9f..dfd5e0c 100644 --- a/Source/Blaster/Character/BlasterCharacter.cpp +++ b/Source/Blaster/Character/BlasterCharacter.cpp @@ -185,6 +185,15 @@ void ABlasterCharacter::AimOffset(float DeltaTime) } AO_Pitch = GetBaseAimRotation().Pitch; + + // Fix pitch/yaw compression + if (AO_Pitch > 90.f && !IsLocallyControlled()) + { + // map pitch from [270, 360) to [-90, 0) + FVector2d InRange(270.f, 360.f); + FVector2d OutRange(-90.f, 0.f); + AO_Pitch = FMath::GetMappedRangeValueClamped(InRange, OutRange, AO_Pitch); + } } void ABlasterCharacter::ServerEquipButtonPressed_Implementation()