From fe7250cfb16ca85292f3013317f35c8270564ebd Mon Sep 17 00:00:00 2001 From: Galcha Date: Sun, 28 Apr 2019 23:26:26 +0900 Subject: [PATCH] Do not disable the boxCollider when jumping If, while jumping, the ceilingCheck hits something, it disables the boxCollider, which is unwanted. --- CharacterController2D.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CharacterController2D.cs b/CharacterController2D.cs index 925bfe0..54a9d3b 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 (!crouch && m_Grounded) { // If the character has a ceiling preventing them from standing up, keep them crouching if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround))