World OverView

This is hard to explain so bare with me

What is unity’s base class?
I have a scene, that consists of a single object ‘Game’
but I want 100’s of scenes, each scene to represent a level
So I want Game to run above, i.e. be parent to all the scenes, how to do this?

i.e. is it possible to have an uber-class/object that runs above the current scene?

ATM I have
Scene(level1)
|-Game

now if I want the opposite Game to be the parent of the current scene, eg what happens if I load a new scene, whats happened to the state of Game

Hmmm understandable

You can use DontDestroyOnLoad: Unity - Scripting API: Object.DontDestroyOnLoad

This way, your Game object will survive when loading different scenes, and can still interact/be-interacted-with by objects in the currently loaded scene.

1 Like

OK thanks I tried that but it just led to a world of hurt, I added it to that class but then it complained it wasn’t enuf so I had to add it to other classes which in turn required some other changes etc.

I found a better method

SceneManager.LoadScene( levelname, LoadSceneMode.Additive );


// and when you want to change the level, unload it and load another scene
SceneManager.UnloadSceneAsync( levelname);