character controller fall on elevator -help-

the elevator is simple, collider that rises and falls, for an animation.
the problem is that when I go to the elevator, the * character controller * falls to move the elevator up.
How achieving the *. Character controller. * Up by elevators without falling?
this is the code with the problem:

#pragma strict
 
    var x :int = 1;
    var controller:CharacterController = null;
    var rapides : float = 6.0;
    var gravedad : float = 20.0;
    var velocidadSalto : float = 8.0;
    var corriendo = false;
    var tiempo : float = 0.0;
           
    private var moveDirection : Vector3 = Vector3.zero;

    function Update()
    {
    var controller : CharacterController = GetComponent(CharacterController);
    if (controller.isGrounded) {
    // We are grounded, so recalculate
    // move direction directly from axes
    moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,
    Input.GetAxis("Vertical"));
    moveDirection = transform.TransformDirection(moveDirection);
    moveDirection *= rapides;
    }
    //
    if(!(x<=0)&&Input.GetButtonDown("Jump")) {
    //
    moveDirection.y = velocidadSalto;
    x--;
    }
    if(controller.isGrounded) {
    x = 1;
    }
    // 
   if (Input.GetButtonDown("Run")) {
   rapides = 9.0;
   corriendo = true;
   }
   else if (Input.GetButtonUp("Run")) {
   rapides = 6.0;
   corriendo = false;
   }
     if(corriendo)
     {
     tiempo += Time.deltaTime;
     }
   if(tiempo >= 7)
   {
   corriendo = false;
   rapides = 7;
   tiempo = 0;
   }


    // Apply gravity
    moveDirection.y -= gravedad * Time.deltaTime;
     
    // Move the controller 
    controller.Move(moveDirection * Time.deltaTime);
    } 
 ///////////////////////////////////////////////////////////////////

I solved my problem with this.

this works on platforms: horizontal, vertical, rotating, diagonal, up and down, animated, everything.

not affect physics, no bounce, no fall. does not affect the performance.

create a new java script with this.
added a new tag. → “movim”

add this script to your character controller, or Rigidbody.

    #pragma strict
    //for Character Controller, Rigidbody, collider or more.
    //you can modify *movim* for what you want.
    var dentro : boolean = false;
    public var scala : float = 1.0000;
     
    function Start () {
    dentro = false;
    }
    function OnTriggerStay ( plataformas : Collider ){
    if(!(dentro) && plataformas.gameObject.tag == "movim"){
    this.transform.parent = plataformas.transform.parent;
    dentro = true;
    //Debug.Log ("In");
    }
    }
    function OnTriggerExit ( plataformas : Collider){
    if(plataformas.gameObject.tag == "movim"){
    this.transform.parent = null;
    dentro = false;
    transform.localScale = new Vector3( scala, scala, scala);
    //Debug.Log ("out");
    }
    }

alt text