problem occur when moving to the hit.point

*this thread isn't connected in any way to the previous one.

there're 2 problems I encouter : 1. When I move to the hit.point so it moves fast at first, and then gradually slowing its speed when im near the hit.point, i want it to go straight with its speed without slowing or anything - i thought because of yield; but without yield; it won't work :/

  1. When I'm standing on the terrain which its surface's height is really high(like a mountain) and moving to a low height so it like flies to that hit.point and not 'walks' to it..

    private var speed = 1;
    var object : Transform;
    var hit : RaycastHit;
    
    var movePosition : Vector3;
    var moving : boolean = false;
    animation.wrapMode = WrapMode.Loop;
    
    function Update(){
          var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
          if (Physics.Raycast (ray, hit, 3000) && hit.collider.tag == "Terrain" && Input.GetButtonDown("Fire1")) {
            if(moving)
            {
                movePosition = hit.point;
            }else{
                movePosition = hit.point;
                MoveObjectToString();
            }
        }
    }
    function MoveObjectToString() {
        moving = true;
            while(Vector3.Distance(movePosition, transform.position) > 0.1){
                animation.CrossFade("walk");
                var controller : CharacterController = GetComponent(CharacterController);
                var direction : Vector3 = movePosition - object.position;
                controller.SimpleMove(direction * speed);
                yield;
            }
            animation.CrossFade("idle");
        moving = false;
    }
    
    

The reason you see the speed problem is because you're not normalizing your direction vector.

Change this line

controller.SimpleMove(direction * speed);

to this:

controller.SimpleMove(direction.normalized * speed);