- Home /
Order of game object deletion when level is unloaded?
Hi,
I recently faced a small problem during level unload. In short, the OnDisable()-method of one game object would access another game object, which was automatically destroyed by then. I redesigned this to avoid the problem, but I was unable to find any documentation on the following question:
Is the order in which game objects are destroyed on scene unload defined anywhere? Or is there no way to rely on a specific order?
What was the link between your problematic game objects ? I never heard anything on this subject.
The link was basically that one object had a kind of "manager" script that controlled other game objects. When the scene was destroyed, the other objects were deleted before the one with the manager object, but still referenced by them.