Add speed check to allow firing when movement speed is low enough while sprint key is held

This commit is contained in:
baz 2024-03-05 16:02:05 +00:00
parent c5edf56955
commit 0ec7f89c57
1 changed files with 1 additions and 1 deletions

View File

@ -249,7 +249,7 @@ void APlayerCharacter::EndJumpCallback(const FInputActionInstance& Instance)
void APlayerCharacter::BeginFireCallback(const FInputActionInstance& Instance)
{
if (CurrentWeapon == nullptr || CurrentWeapon->GetCurrentWeaponStatus()->GetValue() != Idle || IsSprinting)
if (CurrentWeapon == nullptr || CurrentWeapon->GetCurrentWeaponStatus()->GetValue() != Idle || (IsSprinting && GetVelocity().Length() > 500.0f))
{
return;
}