title: How to spawn enemies in a certain range but not in-camera?
body: <p>so I'm making a 2D platformer and I would like to spawn enemies on the whole map but not in the camera range.
  I have to mention I am using Cinemachine to follow the player.</p>
  <p>This is my script for the spawner:</p>
  <pre><code>*public class MobSpawner : MonoBehaviour
  {
      public GameObject Mob;
      float randX;
      Vector2 whereToSpawn;
      public float spawnRate = 2f;
      float nextSpawn = 0.0f;
      public GameObject Camera;
      // Start is called before the first frame update
      void Start()
      {
      }
      // Update is called once per frame
      void Update()
      {
          if (Time.time &gt; nextSpawn)
          {
              nextSpawn = Time.time + spawnRate;
              randX = Random.Range(-36f, 62);
              whereToSpawn = new Vector2(randX, transform.position.y);
              Instantiate(Mob, whereToSpawn, Quaternion.identity);
          }
      }
      
  }*
  </code></pre>
  <p>As you can see I'm taking 2 points and in between them I spawn enemies. As this range would basically be the entire map, the camera will always be in it.</p>
  <p>I want enemies to NOT spawn inside the camera yet spawn outside of it. How can I manage to do this?</p>