From 0ec7f89c57b229dbbda0843df48d3c703db31301 Mon Sep 17 00:00:00 2001 From: baz Date: Tue, 5 Mar 2024 16:02:05 +0000 Subject: [PATCH] Add speed check to allow firing when movement speed is low enough while sprint key is held --- Source/Nakatomi/PlayerCharacter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index 5ef8455..7de6840 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -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; }