Is there a way to determine when an object goes off camera?

Is there a way to determine when an object goes off camera (so I can do something like destroy the object as soon as it is no longer visible in main camera’s view)? Thanks

You can use OnBecameInvisible for that: http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnBecameInvisible.html

Note that this won’t fire as long as the object is visible in any camera, including the editor’s scene view (i.e. can be tricky to test).