How can I ensure randomly positioned objects don't appear off camera?,How to ensure new game objects don't get created off camera? How to tell when those game objects go off camera?

I’m trying to build a pretty simple scene, but don’t know where to start. I want the object to appear randomly on the screen (or slightly below it), then work its way to the top of the screen. Sure, I can hard code some min and max values, but that limits me to a certain range screen sizes/resolutions. I’d much rather be able to drop these objects anywhere on any screen.

I have a few ideas: 1) Is there a way to get the plane that the camera stares at? 2) if not, is there some easy vector math I can do on the camera’s properties to find out if a point is on/off camera?

Thanks!,I’m trying to make an object appear on screen (or slightly to the bottom of the screen). The object moves toward the top of the screen. The problem is: I want to populate the scene randomly. Sure, I can hard code in some min and max values, but then I lock myself into a range of screen sizes.

I think what you are looking for is Unity - Scripting API: Camera.WorldToScreenPoint
to transform a world position vector into a screen point .
Notice that the screen point coordinate on both X and Y axes goes from 0 to 1. So, if on a certain axis this value is less than 0 or greater than 1, then the object is outside the screen.