title: How to make an enemy AI that would follow the player without rotating or looking at the player?
body: <p>I am new to programming and I am making a 2D side-scrolling beat em' up for my project. I got an AI working for my enemies but my enemy objects are modelled to be flat so only one side is meant to be shown. When I start my game, the enemies immediately rotates to face the player when i wanted it to stay as it is but still move towards the player.</p>
  
  <p><a href="http://i.imgur.com/TJYtfro.png" rel="nofollow">http://i.imgur.com/TJYtfro.png</a> This is what I want the enemies to stay as, just having this face shown as it slides towards the player without rotating or tilting.</p>
  
  <p><a href="http://i.imgur.com/n0gI2Rf.png" rel="nofollow">http://i.imgur.com/n0gI2Rf.png</a> This is what happens when I start the game which is why I do not want the objects to rotate or tilt. If you want additional informations of what I have done or if I am unclear, just let me know. It is my first time asking online.</p>
  
  <p>This is the code I got for the enemyAI. I know the code is all wrong when it comes to what I wanna achieve but I have very limited coding knowledge and still learning.</p>
  
  <pre><code>//------------Variables----------------//
  public Transform target;
  public int moveSpeed;
  public int rotationSpeed;
  public int maxdistance;
  private Transform myTransform;
  //------------------------------------//    
  
  void Awake()
  {
      myTransform = transform;
  }
  
  
  void Start ()
  {
  
      maxdistance = 2;
  }
  
  
  void Update ()
  {
  
  
      if(Vector3.Distance(target.position, myTransform.position) &gt; maxdistance)
      {
      //Move towards target
      transform.LookAt (target.position);     
      myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
  
      }
  }   
  </code></pre>