Right way for performance, divide scene?

Glad you asked… going this route definitely requires slightly-higher awareness of what scene is what.

In no particular order, responding to you questions,

  • When the game or level is over, I try to go to a fresh “end level” scene (not additively!) and clear everything else out (except overall ongoing game manager obviously, as a singleton)

  • when the game gets paused I stop time and bring up a pause scene that sorts above all else, then unload it and restart the time. OR if you quit, I just go straight to the gameover scene, which loads only itself and maybe UI (or else mainmenu)

  • I usually make the content scene (what constitutes the level) be the active scene. This lets it have custom lighting.

  • When I spawn things like bullets (or enemies), I often parent them to a bullet manager GameObject, which probably lives in the player scene. You can always change which scene a GameObject is in, if you really care.

  • when the player dies and respawns I usually unload his scene, then load it afresh. That scene has enough logic in it to look around for waypoints that might have been triggered as a result of making it to a certain point in the level, or else falls back on the default content initial spawn point

Overall your strategy above seems reasonable. The devils are often in the details, and keeping things separate makes it easier to organize things differently as your needs or priorities change during development.

ALSO: put in lots of Debug.Log() spew that says stuff like “UNABLE TO FIND PLAYER SPAWN!” so you can quickly diagnose errors during testing.

The one thing I haven’t solved yet is warnings about having multiple audio listeners at once. Depending on how long it actually takes to async load a scene, various platforms may spuriously produce this warning for a couple of frames. However, I’ve never seen a customer-facing issue about it.

The other thing to watch out for is to NEVER have zero cameras. On certain platforms like Android, this will result in a garish flash of garbage graphics. I often put a camera in my main level-loading scene and turn it off after a few frames. That’s easy to test by inserting a Debug.Break() when you start a new game and then single-stepping Unity to make sure there is always a camera each frame.

5 Likes
Loading levels (950158)
2D open world - one single scene vs multiple scenes, performance concerns
Overall project structure for level based game
How to create a loading system with refrences to other instances?
Addictive Scene UI and Games
Maintaining DontDestroyOnLoad method after object becomes a child to another object.
What are some good practices for a healthy scene?
Best way to initialize HUD GameObjects?
online LOAD: racetrack only when needed
Scenemanager
Should I create different scene for different cutscene ?
Tilemap and loading scenes
Assetbundle *.asset
Minigame 'spawn'
ELI5 multiple / additive scenes..
LoadScene destroying whole scene
Help, Canvas settings and Scene, Canvas or GameObject style?
SceneManager.LoadSceneAsync() is unloading scenes when called
multiple Scenes vs 1 scene and multiple panels vs 1 scene vs multiple canvases?
Question about pseudo scene change
How to keep consistent skybox through scene transitions? (869499)
Running multiple scripts through one "parent" script - is this bad practice?
Daily Events and content changes
All objects have moved out on coordinate Z
How do you approach game design in Unity? WYSIWYG Principal?
Faster load times when reloading current scene?
Tutorial w/Alien Videogame Shop, Beachside, and Architectural Scenes
Getting rid of flickering when doing additive scene unloading and loading (Oculus Quest)
Append world data?
Best way to manage my levels
Transfer a gameobject between specific scenes
How do you pass run parameters into a scene when loading? (for a puzzle game with lots of puzzles)
Best practice for transitioning scenes in XR?
Rebuild of the same scene
Can't Find Subscene Creation
How to have different UI for different screen ratio
Pre-loading multiple scenes to avoid loading times
Unity Does Not Remove Unused Assets even they're if outside Resources folder
Adding guardrails around nested prefabs
Should the fields of a 2D RPG be divided into scenes?
Are 768 levels too many?
Implementing primitive subtitles
Best way managing panels
How should the menu of a Unity project be structured?
How to Organize Many Minigames in a Game
Switching between additive scenes
Handle scene management with Additive Scene
Anyone Know why Do Not Destory on Load dose this
Load / unload scene additively and set active the loaded scene ?
Help getting text boxes to change during scene changes
What's your "Loading strategy" ? (loading scenes, assets, performing long running operations, etc.)
SceneManager - permanent level?
Unity Scene Merge Conflict With Git
How to apply light settings across ALL scenes without having to set each manually?
Bug? Duplicating Object Causes An Issue.
Fog working in editor but not in build
Best practices for communicating between scenes?
How to find nodes from different scenes is multi-scene?
Load StartUp-Scene VS Isolated-Scenes
Question on how to spawn Player at a specific point
Skybox and Fog Colour Change When the Scene Changes
Correct Method for Notifying Other Scripts of Game Start?
Best way to handle common GameObjects
Need some advice about how to control different scene dependencies
Manage scene loading