From c536632c9857784a5ecbacfbf7d02dfbe112487f Mon Sep 17 00:00:00 2001 From: Fredrik Lillemoen Eiding Date: Mon, 6 Nov 2023 20:20:26 +0100 Subject: [PATCH] fix crouchspeed locked by jump --- Assets/Scripts/Control&Input/PlayerMovement.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Control&Input/PlayerMovement.cs b/Assets/Scripts/Control&Input/PlayerMovement.cs index 803897fe2..aa3099faf 100644 --- a/Assets/Scripts/Control&Input/PlayerMovement.cs +++ b/Assets/Scripts/Control&Input/PlayerMovement.cs @@ -130,10 +130,11 @@ private void SetCrouch(InputAction.CallbackContext ctx) if (ctx.performed) { + if (IsInAir()) + return; animator.SetBool("Crouching", true); strafeForce = strafeForceCrouched; - if (!IsInAir()) - inputManager.gameObject.LeanMoveLocalY(localCameraHeight - crouchedHeightOffset, 0.2f); + inputManager.gameObject.LeanMoveLocalY(localCameraHeight - crouchedHeightOffset, 0.2f); } if (ctx.canceled)