So here is my problem…
I have a scene with a GameObject which has a script that causes it to instantiate a GameObject that draws parameters from random scriptableobjects every second. The objects destroy themselves shortly after.
Now when I test the scene everything looks perfect. The objects spawn just fine, and I get ZERO errors.
While testing however, if I navigate to a new scene, then BACK to the Original scene with the Spawner, the very first object spawn comes back missing the reference to the scriptableobject. every object after that works perfectly.
But that first object gives me
NullReferenceException: Object reference not set to an instance of an object,
which stacks every frame until the game object destroys itself. The Spawner is on Update()!
Anyone have any ideas what could be causing this to happen?