title: Make objects spawn correctly within different screen widths sizes unity
body: <p>I made my first game in Unity. It should be published to Android and iOS. Everything is working fine except the asteroids are cut off when I change the screen ratio to 9:18(Samsung S8, Lg G6...) The asteroids are being cut off because the spawn points are fixed to -2.4f to 2.4f. I tried various things but nothing worked...I was already told to use screen.width and then to make some logic but I have no idea how to make the logic so that it actually works.
  <a href="https://i.stack.imgur.com/fCU0y.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>Here is my code that is spawning the asteroid in scene: <code>Instantiate(asteroid1prefab, new Vector3(Random.Range(-2.4f, 2.4f), 6, 0), Quaternion.identity);</code></p>
  
  <p>Any kind of help would be appreciated thank you</p>