I am wondering how I would approach the idea of deleting an object when it has exited the camera view. My situation is a script is attached to a turrets base instead of a bullet prefab and it seems that OnBecameInvisible only works on the object the script is attached to. Can I use OnBecameInvisible with an object that the script is not attached to(such as a bullet)? If not, what way would you recommend going about this?
Attach a script using OnBecameInvisible to the object that you want to be affected.
–Eric
It bugs me to use a script just to do that. I am looking to do what I need without creating it’s own script for it.
It’s the cleanest and easiest thing to do, so don’t let it bug you. Unity uses a component-based architecture.
–Eric