- Home /
Question by
aphexyuri · Mar 01, 2012 at 07:55 PM ·
gameobjectscenevariableloadlevelmissingreferenceexception
Keep GameObject to variable linkage on LoadLevel
I have a scene containing a game that get's loaded into a main scene...the idea is to have multiple games that will all be launched from this main scene.
When I load the game scene the first time, all is well...the GameObjects I've assigned via the editor to variables in scripts not null. But...when I unload the scene by loading a blank scene, and then re-load the game scene, the game scene loads fine, but many of the gameobject variables are now null.
How can I have the consecutive scene loads be the same as the first...in the sense that it retains GameObject to var linkage?
This is the error:
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Any advice appreciated!
Comment