So I’m trying to create a script where if the GameObject leaves the view of the camera but still exists (because objects will be destroyed, but that isnt meant to trigger this), for now it will debug log “Invisible”. However, whether I destroy it or not, it still debugs that.
Heres the script-
#pragma strict
function Start () {
}
function Update () {
}
function OnBecameInvisible () {
if (gameObject != null){
Debug.Log ("Invisible");
}
}
Thanks