Player Crouch Problem

hey i have a little problem with my character movement script and my character can stand and crouch now if my player is standing and then goes to crouch (which i play an animation and and change the collides height) my character falls through the ground. its because (I think)i have a state called fall then the player is falling the collides is the equivalent to the stand collides height. i check to see if my player is falling with CharacterController.isGrounded and it its not and my player is not jumping change state to fall. but then my player goes into crouch from stand state the collides is off the ground for a fraction of a second and it thinks its falling. then when my character becomes grounded its automatically set to transition to the state stand where the collider goes through the ground and i fall.

my questions are:

  1. how do i fix this problem should i: make a timer to check if the player has not been grounded for like 1/2 a second or so then make them fall OR should i use a raycast and check if there is is ground 0.1 of a unit below?(can the detection range for isGrounded be changed? it that a built-in feature) !!can you give examples of code!!
  2. is there a better was to change the Collider’s height for example in stead of extruding the collider up and down and then changing the center for the character controller is there a way of just extruding the charactercontroller’s collider just up so then i wouldn’t need to offset it and it would stay grounded?
  3. if you have any other ideas on a better way to change the colliders for different states. id like to hear about it.

Thanks for reading ~Scott
:slight_smile:

I think this guy already do this : How to Make the FPS Character Controller RUN and CROUCH - Unity Answers