title: Screen Width from screen space into world space Unity3D
body: <p>I instantiate a gameobject along the X Axis . Here is my Code:</p>
  
  <pre><code>public Transform brick;
  
  void Update()
  {
     for (int x = 0; x &lt; Screen.width; x++)
     {
       Instantiate (brick, new Vector3 (x, transform.position.y, 0), Quaternion.identity);
     }
  }
  </code></pre>
  
  <p>But the problem that the value of Screen.width is in pixels so , when I instantiate my object it cross the red line in the picture. Should I use ScreenToWorldPoint , I please how can I use it , in my code , I 'm new to unity.</p>
  
  <p>PS: in my project I am using a perspective camera</p>
  
  <p><img src="https://i.stack.imgur.com/wPUwi.png" alt="enter image description here"></p>