private void Update() { if (input.isCrouching) { isCrouching = !isCrouching; isRunning = false; controller.ChangeCollider(isCrouching); } if (input.isRunning) { isRunning = !isRunning; isCrouching = false; } CalculateVelocity(); HandleWallSliding(); if (input.jumpInput) { JumpInputDown(); } if (input.jumpInputOver) { JumpInputUp(); } if (input.directionalInput.x == 0) { isRunning = false; } controller.Move(velocity * Time.deltaTime, input.directionalInput); if (controller.collisions.above || controller.collisions.below) { if (controller.collisions.slidingDownMaxSlope) { velocity.y += controller.collisions.slopeNormal.y * -gravity * Time.deltaTime; } else { velocity.y = 0; } } }