OnBecameVisible not working on Instantiated object

During the scene load, I instantiate a new GameObject from my Resources directory. (This loads the object just fine in my scene). I then add a component (script) with:
obj.AddComponent<ScarabScript>();

In the script file, I know it’s attaching correctly since the void Start() and void Update() both give output when I have debugging statements within them. However, the private void OnBecameVisible() function never triggers, even when the object is in clear view in the scene.

What’s more odd is I have the exact same script (in a different file) setup for another object I Instantiate earlier in the New Scene function that works just fine. I can’t figure out why it won’t link up or ever trigger. Is there a better or alternative solution?

If you’re instantiating it, can you not use OnEnable(); or Awake(); functions to do your tasks?
This function is relating to the rendering of the object and is worth noting that it is affected by all camers including the scene cameras.
Not so sure you can rely on it being called if it’s instantiated into view as it quite possibly doesn’t call OnBecameVisible(); as it wasn’t even alive yet.

Try putting it out of view and back in again to see if it’s called then. If it does call then you might need to instantiate it off screen first or use the other methods.

I’m guessing it’s the same setup as the one that does work but make sure that your script is attached to the same object as the renderer.