Render.IsVisible returning false for one frame

I have a gameobject that starts out in the center of the camera at startup. For some reason the first frame when the game starts the Gameobject.renderer.IsVisible returns false for just one frame then returns true for the remaining frames. I have this object coded to move down the screen and have code in place to destroy it when it goes offscreen

`
void Update()
{
    // If gameobject is off screen
    if (!gameObject.renderer.isVisible)
    {
        Destroy(this.gameObject); // Destroy the gameobject
    }
}
` Now since the GO is considered not visible for the first frame it is destroyed immediatelly. Can anyone tell me why its doing this?

It could be that your update(); function is being executed before the falling object is done rending, and thus the isVisible property hasn't been set to true yet. Try putting in a boolean that determines if the object was ever visible, and only run the function after that boolean was set.

You can use a coroutine in the following manner instead of going for another variable.

public class NotifyIfRendererInvisible : MonoBehaviour
{

public delegate void OnRendererInvisible();

public OnRendererInvisible OnRendererInvisibleCallback;

void Start()
{
	StartCoroutine(CheckForVisibility());
}

//This is a coroutine to check after the end of frame if its visible or not.
IEnumerator CheckForVisibility()
{
	while(true)
	{
		yield return new WaitForEndOfFrame();
		if (OnRendererInvisibleCallback != null && !renderer.isVisible)
		{
			OnRendererInvisibleCallback(); 
		}
	}
}

}

I made it event based, if you want you can remove this and destroy the object directly. But I suggest to pool instead of destroying the objects runtime.