title: Unity Ai GameObject Keeping increasing his speed when he moving
body: <p>i did some code making an enemy search if the player exists or not and if the player exists go-to player to kill him the code is working fine but every moment the enemy move the speed keep increased and i do not want the speed increased at all so how to make it moving at the same starting speed without any increase 
  this is my code</p>
  
  <pre><code>void Update () {
      if (target == null) {
          if (!searchingForThePlayer) {
              searchingForThePlayer = true;
              StartCoroutine (searchForPlayer ());
          }
          return;
      }
  
      if (Vector3.Distance (target.position, transform.position) &lt; 20) {
  
          transform.position = Vector2.MoveTowards (transform.position, target.position, 1f * Time.deltaTime);
          if (target.position.x &lt; transform.position.x &amp;&amp; !facingRight) 
              Flip ();
          if (target.position.x &gt; transform.position.x &amp;&amp; facingRight)
              Flip ();
  
      } else {
  
      }
  
      StartCoroutine (UpdatePath ());
  }
  IEnumerator searchForPlayer () {
      GameObject sRusult = GameObject.FindGameObjectWithTag ("Player");
      if (sRusult == null) {
          yield return new WaitForSeconds (0.5f);
          StartCoroutine (searchForPlayer ());
      } else {
          target = sRusult.transform;
          searchingForThePlayer = false;
          StartCoroutine (UpdatePath ());
          yield return null;
      }
  
  }
  IEnumerator UpdatePath () {
      if (target == null) {
          if (!searchingForThePlayer) {
              searchingForThePlayer = true;
              StartCoroutine (searchForPlayer ());
          }
          yield return null;
      } else {
          if (Vector3.Distance (target.position, transform.position) &lt; 20) {
  
              transform.position = Vector2.MoveTowards (transform.position, target.position, 1f * Time.deltaTime);
              if (target.position.x &lt; transform.position.x &amp;&amp; !facingRight)
                  Flip ();
              if (target.position.x &gt; transform.position.x &amp;&amp; facingRight)
                  Flip ();
  
          } else {
  
          }
      }
      // Start a new path to the target position, return the result to the OnPathComplete method
  
      yield return new WaitForSeconds (1f / 2f);
      StartCoroutine (UpdatePath ());
  }
  
  void Flip () {
      Vector3 scale = transform.localScale;
      scale.x *= -1;
      transform.localScale = scale;
      facingRight = !facingRight;
  }
  </code></pre>