Slowing down a fall from a Jump

Does anyone know how to slow down a character when falling down? Here's the movement code I'm using:

private var jumpSpeed : float = 12.0;
private var gravity = 100.0;
private var moveDirection : Vector3 = Vector3.zero;
private var charController : CharacterController;
function Update ()
{
    if(charController.isGrounded == true)
    {

        if(Input.GetButtonDown("Jump")){
        moveDirection.y = jumpSpeed;
        //audio.PlayOneShot(Jump);
    }

    }

    moveDirection.y -= gravity * Time.deltaTime;
    charController.Move(moveDirection * (Time.deltaTime * walkSpeed));
    transform.position.z = 0.0;
}

What I mean is that the player jumps and lands too fast for the player to make accurate movements while trying to jump on a platform.

You should split your editing into parts

if horizontal move --> moveDirection = new Vector3(moveDirection.x + changeValue in x, moveDirection.y, moveDirection.z);

if B vertical move --> change moveDirection vector = new Vector3(moveDirection.x, moveDirection.y + changeValue in y*/, moveDirection.z);

if C --> change moveDirection vector = new Vector3(moveDirection.x, moveDirection.y, moveDirection.z + changeValue in z);

Splitting the logic like this can help you keep track of who is doing what when (The flow of the code)

The problem is that only JS will let you change the existing x .y .z. It's not the perfect solution since u keep reconstructing and editing exsiting values. But it demonstrates that you can maintain good logic in the code.

To fall down slower now looks like a simple solution.

Change the y value in the B example on the event when u want it and keep doing that with a small number untill you want to stop. The stop condition can be a clock , a max speed value or user input. Whatever you like

EDIT 11/22/2010 22:45:

Make a variable , sample name V

//Initial value is (0.0f, 0.0f, 0.0f)
private Vector3 V = new Vector3.zero;
private float jumpHeight = 10.0f;

//Null object
private CharacterController c;

//Now to get the motion you want into the V vector with destroying previous changes
V = new Vector3(V.x, V.x + jumpHeight, V.z);

//Get the character controller on this object
if(GetComponent<CharacterController>() != null)
{
    //Set the (not null by proof) component into the variable
    c = GetComponent<CharacterController>();
}    

    //Execute the move with the following unity function
    //It demands a parameter so it knows WHERE to go
    c.Move(V);

Sorry about all the C#. I don't really know where to start in JS except just putting var everywhere. Hope this helps out enough

What do you mean by slowing down? He will fall slower and slower and finally stop falling down? You have an error in your script, you are applying walkspeed to your gravity, which you probably don't want to.

Most platform games have a maximum speed at which you fall down (or jump up), I'll assume that this is what you mean. In that case, just limit the maximum vertical speed difference you apply to the character:

var V_SPEED_LIMIT : float = 5.0;

var limitedVerticalSpeed : Vector3 = Vector3(
        moveDirection.x,
        Mathf.Clamp(moveDirection.y, -V_SPEED_LIMIT, V_SPEED_LIMIT),
        moveDirection.z);

charController.Move(limitedVerticalSpeed * Time.deltaTime);

As spree pointed out, you probably don't want to apply your walkSpeed to gravity.

Never mind. I got it now by playing with the variables.