- Home /
Question by
mzaidan1996 · Aug 01, 2020 at 04:29 PM ·
scripting problemscript.scripting beginnercrouchcrouching
My Player is going through the floor after crouching
I created this basic crouching system and my character keeps going through the floor after I finish crouching, here is my script: private void StartCrouch() { playerCollider.transform.localScale = new Vector3(1f, 0.4f, 1f); walkSpeed = 2f; sprintSpeed = 2f; jumpForce = 6f; jumpcoolDown = 0.5f; isCrouching = true; } private void EndCrouch() { playerCollider.transform.localScale = new Vector3(1f, 1.4f, 1f); walkSpeed = 4.5f; sprintSpeed = 8.5f; jumpForce = 13f; jumpcoolDown = 0.65f; isCrouching = false; }
This is the crouching aspect of it, and somehow my player is completely going through the floor. Anyone know how to fix this?
Comment