[UE5.4] How do levels work?

And just for clarity, I have a LOT of assets that are common to each level. It’s kind of a pain to duplicate them every time. I had all of this in a common set of actors.

For example, you can preview assets in game in a UI widget. I have a capture camera that grabs the image realtime. It lets me animate the image. This is the same setup in all levels. So level streaming really seemed like the way to go at first. It worked really well. Until I tried to set up navigation and lighting. Then all hell broke loose.

So why isn’t it just load level, load UI, load level… because of all the common stuff. I’ve now started to separate them. All the UI logic, I’ve taken out of the actors and put it into a UObject. I didn’t want to clutter the GameInstance until I knew it was working. The GameInstance does maintain it and allows access to it. That part is actually working well.

As for the preview stuff, I’ve put those into a level instance. That seems to work well, but when you call OpenLevel on a new level, the old level instances still remain and I get duplicate copies of the level instance. I thought OpenLevel got rid of the old level, but apparently not.

OpenLevel is what I’m struggling with. It’s doing nothing of what the documentation says. It doesn’t fully unload the old level. It doesn’t respawn my player character. It doesn’t get rid of old level instances. And it never finishes initializing the actors in the level. Probably why it never triggers OnWorldBeginPlay or OnActorsInitialized. The level remains uninitialized and unusable. The level is stripped down and is fine. It works in the level streaming version of the project (without lighting).

So I have no idea what is going on or how any of this is supposed to work.