To change the size of a collider while crouching, follow these steps:
- Import the character with Idle, WalkLeft, WalkForward, WalkRight, IdleCrouch, WalkLeftCrouch, WalkForwardCrouch, and WalkRightCrouch animations.
- Create a new Animator Controller.
- Right-click on the empty space of the controller and choose Create State | New From Blend Tree. We need two such states. Name one of them Idle and the second one Steering.
- Create three float parameters in the controller: Speed, Direction, and Crouch.
- Create two transitions:
- Idle | Steering with one condition: Speed parameter value greater than 0.5. Has Exit Time should be set to false and Transition Duration set to around 0.2 seconds.
- Steering | Idle with one condition: Speed ...