title: Get mouse position in world space
body: <p>I'm making a game using Unity and I have a little issue, I need to know the mouse position in world space, for that I try to set a GameObject at the mouse position using this code : </p>
  
  <pre><code>    Vector3 p = Input.mousePosition;
      Vector3 pos = Camera.main.ScreenToWorldPoint( p);
      testGameObject.transform.position = pos;
  </code></pre>
  
  <p>It works like a charm in Editor but in exe / apk, the GameObject dosn't follow the mouse:</p>
  
  <p><a href="https://i.stack.imgur.com/1tc8v.png" rel="nofollow noreferrer">Example 1</a></p>
  
  <p><a href="https://i.stack.imgur.com/w2S8S.png" rel="nofollow noreferrer">Example 2</a></p>
  
  <p>The GameObject that is supposed to follow the mouse is the "1" inside a circle</p>