Spawn a prefab off screen?

Hey I’m setting up enemy spawning for my game and ran into a problem. The enemies spawn at predetermined spawn points stored in the Spawn Manager object. That works just fine but what I want is for the enemies to only spawn at a spawnpoint location that is not currently on screen and am drawing a blank on how to do that.

So I guess my question is…how do I check if a world position is currently visible on screen without it having a renderer of any sort?

Hi mate not sure if this solves your problem, but could you use the Renderer.isVisible property.

  1. Add an empty renderer to you spawn points

  2. Find the object you want to check is on the screen

  3. Get the Renderer component attached to the object

  4. Read the Renderer’s isVisible property

Just a heads up, the object is considered “On the screen” even if it’s only its shadow is showing!

Hope this helps =D