how do you make a crouch script???

I’m working on a game and placed a fps controller, you can move around and jump but how do you make a script that can have the player crouch using CTRL button ??? please explain how i would add it to the player too.

I think you should watch this, This guy teach how to do a FPS controller using Unity3d http://www.youtube.com/playlist?list=PL7AE076AFAFD3C305

on ctrl button press reduce character’s speed and collider’s height

HELLO…

i have done some work on this kind of movement for third person controller, where you can go for an crouch animation,that u will get from your character designer,just play that animation on pressing the ctrl button,also you need to rescale your colliders or switch the colliders for your crouched character so that you can detect the collision with that only…
hope this will help you…

Thanks
Niki.j

There is an excellent script by Aldo called Run and Crouch, from this you can learn (as I did) how to modify the variables of the Character Controller component. Use the EDITED 2 version : How to Make the FPS Character Controller RUN and CROUCH - Questions & Answers - Unity Discussions