OnBecameInvisible behaviour varies by GameObject Primitive Type

I have discovered that OnBecameInvisible is triggered immediately for cubes, but not for cylinders.

I have a scene with just two game objects (as per below) and OnBecameInvisible is triggered as soon as the cube is no longer visible (as expected). However, when the cylinder is no longer visible, OnBecameInvisible is not triggered right away. Instead, in order to get OnBecameInvisble to be triggered by the cylinder’s invisibility, I have to keep moving further away (in the direction that made the cylinder no longer visible)

public class CreatePrimitives : MonoBehaviour
{
    void Start() {
        // Create cube of certain dimesion at certain location
        GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
        cube.transform.position = new Vector3(-40, 0, 0);
        cube.transform.localScale = new Vector3(40, 40, 40);
        cube.GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
        cube.GetComponent<Renderer>().receiveShadows = false;;
        cube.AddComponent<OffLimits>();

        // Create cylinder of certain dimesion at certain location
        GameObject cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
        cylinder.transform.position = new Vector3(40, 0, 0);
        cylinder.transform.localScale = new Vector3(40, 20, 40);
        cylinder.GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
        cylinder.GetComponent<Renderer>().receiveShadows = false;
        cylinder.AddComponent<OffLimits>();
    }
}

public class OffLimits: MonoBehaviour
{
    private void OnBecameInvisible() {
        Debug.Log($"{this.name} now offscreen.");        
    }
}

What I’d like to know is if that is expected (documented) behaviour or a glitch? My scene is as simple as possible with shadow effects turned off. I have also tinkered with all the different settings in my DirectionalLight trying to get the cylinder to be more responsive to OnBecameInvisible, but to no avail. Even tried OnBecameInvisible as a coroutine.

The same OnBecameInvisbile “delay” is also present for cylinders made with ProBuilder.

Many thanks.

OnBecameInvisible and OnBecameVisible are affected by all cameras, including the sceneview camera. The object must not be visible in any camera.

ps: Also the visibility is checked against the AABB (axis aligned bounding box) of the object. So depending on the orientation the bounding box may be larger than the actual mesh, especially at the corners.

Try to disable the shadows of the object that you want to call OnBecameVisible-OnBecameInvisible for it.
It worked for me.