Returning initial point

Hi guys i create and Enemy AI script and it works fine, (i hv an enemy that is in inicial position nad if i go inside range he start follow me. if i go out of range he stop chase. when is not chasing i use idle animation. wt i want to know is how i can get it to return the inicial position if i get out of chase range and stay their in idle animation?) i try a lot of things but no one work if anyone can help i will appreciate.

~using UnityEngine;
using System.Collections;

public class Mob : MonoBehaviour
{
    public float speed;
    public float range;
   
    public CharacterController controller;
    public Transform player;
    private Fighter opponent;        //copy of fighter script
   
    public LevelSystem playerLevel;
   
    public double impactTime = 0.36;
    private bool impacted;
    public int experience;
   
    public AnimationClip idle;
    public AnimationClip run;
    public AnimationClip die;
    public AnimationClip attackClip;
   
    public int maxHealth;
    public int health;
    public int damage;
   
    private int stunTime;                            //time that enemy will be stunned

    float chaseRange = 15.0f;

    float distance;

    // Use this for initialization
    void Start ()
    {
        health = maxHealth;
        opponent = player.GetComponent<Fighter>();

    }
   
    // Update is called once per frame
    void Update ()
    {
        if (!isDead ())
        {
            if(stunTime<=0)
            {
                if (!inRange ())
                {
                    chase ();
                }
            }
            else
            {
               
            }
        }
        else
        {
            dieMethod();   
        }
    }
   
    void attack()
    {
        if (animation [attackClip.name].time > animation [attackClip.name].length * impactTime && !impacted && animation[attackClip.name].time<0.9*animation[attackClip.name].length)
        {
            opponent.getHit(damage);
            impacted = true;   
        }
    }
   
    public void getHit(double damage)
    {
        health = health - (int)damage;
       
        if (health < 0)
        {
            health = 0;   
        }
    }
   
    public void getStun(int seconds)
    {
        CancelInvoke ("stunCountDown");
        stunTime = seconds;
        InvokeRepeating ("stunCountDown", 0f, 1f);
    }
   
    void stunCountDown()
    {
        stunTime = stunTime - 1;
       
        if (stunTime == 0)
        {
            CancelInvoke("stunCountDown");   
        }
    }
   
    bool inRange()
    {
        if (Vector3.Distance (transform.position, player.position) < range)
        {
            return true;       
        }
        else
        {
            return false;
        }
    }
   
    void chase()
    {
        distance = Vector3.Distance(player.position, transform.position);

        if (distance <= chaseRange)
        {
            transform.LookAt (player.position);
            controller.SimpleMove (transform.forward * speed);
            animation.CrossFade (run.name);
            }
        else
        {
            animation.Play(idle.name);   
        }
    }

    void dieMethod()
    {
        animation.Play (die.name);
       
        if (animation [die.name].time > animation [die.name].length * 0.9)
        {
            playerLevel.exp = playerLevel.exp + experience;
            Destroy(gameObject);
        }
    }
   
    bool isDead()
    {
        if (health <= 0)
        {
            return true;   
        }
        else
        {
            return false;   
        }
    }
   
    void OnMouseOver()
    {
        player.GetComponent<Fighter> ().opponent = gameObject;
    }
}

Log the mob’s position when it first detects the player. When the mob is out of range move back to the logged position and then play your idle animation. You can use the same code you used to chase but put the logged position in the LookAt function. Check the distance between the mob and the logged position to know when it reaches its destination.

Ok i try this one and now mob chase me when inside of range and back to is initial position when out o range but now i get a problem… when it is in is initial position is running like crazy arround that initial position over rotating himself… can u tell me why or wt can i do? this is real annoying me for very long time already… Ty for ur time

using UnityEngine;
using System.Collections;

public class Mob : MonoBehaviour
{
    public float speed;
    public float range;
   
    public CharacterController controller;
    public Transform player;
    private Fighter opponent;        //copy of fighter script
   
    public LevelSystem playerLevel;
   
    public double impactTime = 0.36;
    private bool impacted;
    public int experience;
   
    public AnimationClip idle;
    public AnimationClip run;
    public AnimationClip die;
    public AnimationClip attackClip;
   
    public int maxHealth;
    public int health;
    public int damage;
   
    private int stunTime;                            //time that enemy will be stunned

    float chaseRange = 15.0f;

    float distance;

    private Vector3 initialPosition;

    // Use this for initialization
    void Start ()
    {
        health = maxHealth;
        opponent = player.GetComponent<Fighter>();

        initialPosition = transform.position;

    }
   
    // Update is called once per frame
    void Update ()
    {
        if (!isDead ())
        {
            if(stunTime<=0)
            {
                if (!inRange ())
                {
                    chase ();
                }
            }
            else
            {
               
            }
        }
        else
        {
            dieMethod();   
        }
    }
   
    void attack()
    {
        if (animation [attackClip.name].time > animation [attackClip.name].length * impactTime && !impacted && animation[attackClip.name].time<0.9*animation[attackClip.name].length)
        {
            opponent.getHit(damage);
            impacted = true;   
        }
    }
   
    public void getHit(double damage)
    {
        health = health - (int)damage;
       
        if (health < 0)
        {
            health = 0;   
        }
    }
   
    public void getStun(int seconds)
    {
        CancelInvoke ("stunCountDown");
        stunTime = seconds;
        InvokeRepeating ("stunCountDown", 0f, 1f);
    }
   
    void stunCountDown()
    {
        stunTime = stunTime - 1;
       
        if (stunTime == 0)
        {
            CancelInvoke("stunCountDown");   
        }
    }
   
    bool inRange()
    {
        if (Vector3.Distance (transform.position, player.position) < range)
        {
            return true;       
        }
        else
        {
            return false;
        }
    }
   
    void chase()
    {
        distance = Vector3.Distance(player.position, transform.position);

        if (distance <= chaseRange)
        {
            transform.LookAt (player.position);
            controller.SimpleMove (transform.forward * speed);
            animation.CrossFade (run.name);
            }

        else
        {
               
            transform.LookAt (initialPosition);
            controller.SimpleMove (transform.forward * speed);
            animation.CrossFade (run.name);
        }
    }

    void dieMethod()
    {
        animation.Play (die.name);
       
        if (animation [die.name].time > animation [die.name].length * 0.9)
        {
            playerLevel.exp = playerLevel.exp + experience;
            Destroy(gameObject);
        }
    }
   
    bool isDead()
    {
        if (health <= 0)
        {
            return true;   
        }
        else
        {
            return false;   
        }
    }
   
    void OnMouseOver()
    {
        player.GetComponent<Fighter> ().opponent = gameObject;
    }
}

New code: