Makes a CharacterController Crouch. Handles scaling the collider and transitions between standing and crouching.
The GameObject that owns the CharacterController component.
Crouch while this to true. Normally set by an Input action like Get Key. NOTE: The controller might not be able to stand up when this is false if there's not enough headroom.
Height of capsule when crouching.
Move children so their height scales with capsule. This is useful for weapon attach points etc.
How long it takes to crouch/stand in seconds.
Always complete the full transition to crouching, even if the input is brief.
Can the CharacterController stand if isCrouching is false (e.g. if the crouch button is released). Usually set by a some kind of raycast checking the headroom above the controller,but could also be set to false to prevent standing for other reasons, e.g., crouch because the ground is shaking.
Try to stand if true. Useful if want to toggle crouch with a button.
Event to send when crouch button is released AND there is enough headroom.
Reset Height On Exit
Reset the controller height if the State exits before crouch has finished. Also restores children to original offsets if Adjust Children was used. NOTE: You probably want to keep this checked most of the time.