How i can destroy an object when out of camera view?
Thx you in advance,
How i can destroy an object when out of camera view?
Thx you in advance,
You could make a large trigger that when the objects leave the "sphere of influence" of (OnTriggerExit) they get sent a message (that ultimately leads to a function that kills them).
This would have more control than say, immediately killing something off screen.
I have never tried this, but mabye:
function OnBecameInvisible ()
{
//Destroy your object here.
}
if (!gameObject.renderer.isVisible)
Destroy(gameObject);
Like so :)