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?