My 3D movement controller crouch not working properly

So I have a basic 3D Movement controller and it can crouch, sprint and jump. However, when crouching i change the player height to half its height which works but it causes this crouching to happen very slowly rather than snapping in an instant like it does when you let go of the crouch key and stand up. Can anyone help me make the crouch happen instantly, sorry if this is a dumb question I am very new to unity.

I think you are correctly changing the height instantly, but I’m guessing that when the height of the capsule changes, it shrinks towards the center of the collider, so when the character crouches, they actually shrink away from the floor, taking their “feet” off the ground. Then your character falls with gravity, which looks like the crouch slowly happening.

The solution would be to also move the character down when they crouch by the same distance.