Anyone else have issues with UnityEngine.SceneManagement.LoadSceneMode.Additive going "crazy"?

So… my game takes forever to load; therefore, I have broken it up into smaller scenes that load via a loading script incrementally. As the scenes load, an animation plays.

Everything works fine until…

  1. Load main menu
  2. Choose play game
  3. Loads “base” scene
  4. Additive loads content scenes
  5. Game plays
  6. Game over
  7. Load main menu in #1

You would think everything would be normal in the above logic, but… when I decide to play the game again without exiting, in #4 it loads the content scenes dozens of times and never stops. There is nothing persistent involved (i.e. DoNotDie), but the engine is going “crazy”.

I also found that if I load certain scenes Additively after the game has started, it will auto load other scenes not even linked. There is definitely a bug going on within the engine in this scenario.

Anyone else with scene load, unload, etc. problems?

Are you sure there isn’t a duplicate game object with your “load more scenes” code inside it, perhaps in one of the other scenes that you think you removed it from?

This would cause it to load an ever-increasing number of scenes, over and over again.

1 Like

Actually I figured out what I did wrong. I had onSceneLoaded double +'ed and it was calling the load process recursively since I had not destroyed the object with the script. :slight_smile:

1 Like

Ah yes, to understand recursion, you must first understand recursion.