From 6fdd1d86fa32e7c8d1967355b725a6b5c948ca8f Mon Sep 17 00:00:00 2001 From: France30 <53886711+France30@users.noreply.github.com> Date: Thu, 29 Jun 2023 00:24:16 +0800 Subject: [PATCH] Fix unintentional jump-crouch bug 2D Character Controller unintentionally crouches when a ceiling is detected. This is because we are checking for a ceiling when "!couch". Simple fix was to check if the character was previously crouching. --- CharacterController2D.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CharacterController2D.cs b/CharacterController2D.cs index 925bfe0..67178ce 100644 --- a/CharacterController2D.cs +++ b/CharacterController2D.cs @@ -64,7 +64,7 @@ private void FixedUpdate() public void Move(float move, bool crouch, bool jump) { // If crouching, check to see if the character can stand up - if (!crouch) + if (m_wasCrouching) { // If the character has a ceiling preventing them from standing up, keep them crouching if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround))