Object out off the screen

Hello everybody,
how can I detect if an object is off the screen ? (Destroy outside is not valid for me)


Get the position of camera, get the width and height of camera
Do same for the object.
And use the AABB algorithm (google it).

Or more tricky but maybe not working : the engine hide the object not inside the view of the camera (with a margin of 100px) then if you check the visibility of the object the value should be on false. (Not sure it’s hypothetic)

1 Like

Good idea ! Thanks a lot