57 - Pitch in Multiplayer

This commit is contained in:
Kingsmedia 2022-05-03 23:36:35 +02:00
parent 534cdfe902
commit c090c0a37f
1 changed files with 9 additions and 0 deletions

View File

@ -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()