Simple questions about scenes

Just a few brief questions I still have after going through the tutorials.

  • Changing scenes in the editor seems
    to swap out the items in the
    hierarchy view. That’s fine, but is
    there a way to have root-level,
    project-level game objects?

  • If the answer to the above is no,
    does that mean I have to connect to
    my server anew for each scene? What
    if I have a main scene and a second
    scene open for options and they both
    need server connections?

Thanks for your time to help me with this.

is there a way to have root-level, project-level game objects?

Not exactly, no. It’s a limitation in Unity’s design.

Once an object is loaded, you can tell Unity to keep it between level loads by calling DontDestroyOnLoad. Unfortunately, there’s no built-in way to make sure that a particular object exists in every level.

Some people just make sure to drop a particular prefab into every level. If you prefer a code-based solution, though, you might employ a singleton design pattern: