Player Animation Rotating [SOLVED]

Hi everyone.

I have a player with two animations, idle and walking, I control a transation with a bool variable, but when a transaction walk to idle, the walk animations is rotating.

At below is coding, video and prints:

    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                flag = true;
                endPoint = hit.point;
                endPoint.y = yAxis;
                Debug.Log(endPoint);

                animator.SetBool ("Move", true);

            }

        }

        if (flag && !Mathf.Approximately(gameObject.transform.position.magnitude, endPoint.magnitude))
        {
            gameObject.transform.position = Vector3.Lerp(gameObject.transform.position, endPoint, 1 / (duration * (Vector3.Distance(gameObject.transform.position, endPoint))));

            //Faz com que o objeto olhe para onde foi clicado
            transform.LookAt(endPoint);

        }
        else if (flag && Mathf.Approximately(gameObject.transform.position.magnitude, endPoint.magnitude))
        {
            flag = false;
            Debug.Log("Change Walk to Idle");
            animator.SetBool ("Move", false);
        }
    }

Thanks!

I solved this change my script:

    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                flag = true;
                endPoint = hit.point;
                endPoint.y = yAxis;
                Debug.Log(endPoint);

                //Faz com que o objeto olhe para onde foi clicado
                // I CHANGED HERE!
                gameObject.transform.LookAt(endPoint);

                animator.SetBool ("Move", true);

            }

            //Verifica se tocou nos hints
            if (playerHit) {
                if (hit.collider.name == "HintRuaCantao") {
                    countScore += 10;
                    Destroy (Hints[0]);
                }
                if (hit.collider.name == "HintErosao") {
                    countScore += 10;
                    Destroy (Hints[1]);
                }
                if (hit.collider.name == "HintBueiro") {
                    countScore += 10;
                    Destroy (Hints[2]);
                }
                SetScoreText ();
            }

        }

        if (flag && !Mathf.Approximately(gameObject.transform.position.magnitude, endPoint.magnitude))
        {
            gameObject.transform.position = Vector3.Lerp(gameObject.transform.position, endPoint, 1 / (duration * (Vector3.Distance(gameObject.transform.position, endPoint))));

        }
        else if (flag && Mathf.Approximately(gameObject.transform.position.magnitude, endPoint.magnitude))
        {
            flag = false;
            Debug.Log("Estou aqui");
            animator.SetBool ("Move", false);
        }
    }