var controller : CharacterController;
okay I am trying to create a crouching script, but I am confused seeing as though my Player keeps falling through the collision mesh of the floor. Every time I crouch the player falls through the floor. What can I do so that the character, does not fall through the floor? I have tried "Yield get seconds passed", I have tried putting it in a series of steps but the game just ignores it.
How do I solve this issue?
function Update ()
{
if (Input.GetKey ("c")) {
GetComponent(CharacterController);transform.localScale.y = 0.2;
} else {
GetComponent(CharacterController);transform.localScale.y = 1;
}
}