My additive loading nightmare

I’m just starting with scene loading in a multilevel game, and I’m trying to be economical with the main menu. I’m trying to keep it always loaded by additively loading the actual gameplay levels. But I’m having lots of problems and it’s hard to google.

First off I’m trying to do asynchronous loading, and the AsyncOperation doesn’t seem to set the scene it’s loaded to be the active scene, even if I manually set allowSceneActivation to true. At least it’s not bold in the hierarchy.

Second, the scenes seem to almost act like they’re merged (even though they aren’t). The event systems conflict (maybe that’s the intended behaviour?). I’m pretty sure that for some reason I can only raycast through the camera from the main menu, even if I manually set the gameplay scene to be the active one.

In fact, everything seems to kind of be acting as if it’s in the same scene, so I have to wonder, is there any difference from just having DontDestroyOnLoad (on everything)? I guess that you can “destroy” stuff easily with UnloadScene?

I’d love some explanation as to what’s going on, and advice on how to achieve what I want as painlessly as possible. (I’m guessing DontDestroyOnLoad for the “main menu” canvas should do the trick. Or maybe making it into a prefab.)

They are essentially merged, that’s what “Additive” means… you’re adding the second scene to the first one. If you want the main menu to go away, you shouldn’t load additively, just do the regular load. “allowSceneActivation” doesn’t set a scene to the active one, even though it sounds like that. It just means that it lets it finalize the scene loading. If it’s false, the scene never finishes fully loading until you directly tell it to:

Thanks.

No, I want the main menu to stay. At least in my mind it’s an alternative to having a “main menu” object in every scene, thus ensuring their uniformity, among other things.

Although right now I’m leaning towards, indeed, having a “main menu” (and a UI) object in every scene, with a prefab, and hoping that I don’t forget to apply changes one day.

You can load it additively and then call gameObject.SetActive(false) on the main menu objects. Deactivating them makes them invisible and stops them from receiving collisions or events.

Does it sound like a good idea to first load the scene containing the actual geometry (and enemies) of the level, then, with a script (called something like “LoadFinalizer”), additively load the “Game UI” and “Main Menu” scenes on top of that?

The order doesn’t matter that much. The main way it’s usually done is to first load a “Loading…” screen scene, and then have that in the foreground while you load all the other stuff, and when it’s all done, you can disable the “Loading…” screen.

Okay, I think I’m getting it, thanks. So from the lack of its prominence on the internet (in tutorials and such), additive loading sounds like a nice but hardly necessary extra… and yet now it seems to me that you can barely make a game without it.

Also, wasn’t multiscene editing a Pro-only feature just a little time ago?