title: Unity look at cursor in 2d
body: <p>I'm creating 2D game in Unity 3D, but I have problem with my player rotation.
  It should rotate to the cursor, but when I start the game, its looking at Main camera.<br>
  I've tried lots of codes from lots of tutorials, but in most of it, my player is only looking to the center of Main camera.<br>
  This is my code now:</p>
  
  <pre><code>Vector3 mouse = Input.mousePosition;
  
      Vector3 mouseWorld = Camera.main.ScreenToWorldPoint(new Vector3 (mouse.x, mouse.y, player.transform.position.y));
  
      Vector3 forward = mouseWorld - player.transform.position;
      player.transform.rotation = Quaternion.LookRotation (forward, Vector3.up);
  </code></pre>
  
  <p><br>
  Player is only looking to the camera. I'm not expert, but I think there is some problem with input, because some codes, that I've tried in past, did, that the player was only looking to nothing<br>
  (I'm not best in english... please apologize my mistakes)</p>