Unloaded level still visible after loading next level

Player starts game on level00switch this loads fine, then player moves to the next level01hell this loads fine, then going back to level00switch after death this loads fine, but when going back to level01hell a second time, level00switch does not unload. So I have both level00switch and level01hell visible. I cannot figure out what is wrong in my setup, as everything else is working as expected, any help is appreciated.

Here are the setup BPs

when you start playing the first time, do you start playing from level00switch, or is it a steamed level inside another level?

I start on the first sublevel which is level00switch, the persistent level is blank except for the EventBeginPlay node

yes, but when you start from the very beginning do you open level00switch or is it part of another level? (E.g. level00switch is actually a sublevel of MainMap level or something similar)

What is the name of persistent level? (The name of the level that both level00 and level01 are sublevels of)

Just above the File and Edit menus should be the tab with the name of the level

It is named “LevelPersistent” but there is nothing on it but the level BP with the EventBeginPlay node

I think your problem is that in the very beginning you open a main persistent map that contains level00switch, level01hell and other level as their sublevels. But after you respawn the player you OPEN level00switch (3rd screenshot “open level” node). This makes the contents of level00switch act as persistent level instead of streamed level.

Solution: You should open the main persistent level (in your case the name is LevelPersistent) and load/stream level00switch inside it when you respawn (you are probably already loading/streaming it). This will enable level00 to be unloaded when going to level01.

TL;DR: Change the Open level node in your third screenshot to open LevelPersistent level instead of level00switch.

great, posted answer

OMG! that fixed it!! THANK YOU!!!

My pleasure, good luck good sir

I know it has been a lot of time since this problem was solved, but I am experiencing something similar so I would like to ask for advice.

In my case, I am not using the “Open Level” node. I have a persistent level, which only has a camera and the UI. Then, I have a drop down menu where I display all the sublevels that I have stored in a specific folder, and when I click one, it loads it, and the other ones are unloaded.

The problem is, most of them are not unloading. All the levels seem to have the same settings, like the “Streaming Method” set to “Blueprint”, but only one level is unloading correctly, and I can’t figure out why.

I’m attaching the blueprint system I am using for this. Am I doing something wrong?

Thank you in advance for any help!

Where does the code shown in the picture run? (actor, level bp, game instance…etc)

I’m running it directly in the UI Widget BP, which is created by the persistent level.

Try unchecking/clearing the “Should Block on UNLOAD” checkmark

It didn’t cause any change :frowning:
By default both options were unchecked, but either they are checked or unchecked doesn’t seem to change anything…

Did you put all the level names correctly into the array?

Congratulations and good luck with your project, thanks for sharing the solution/bug!

Yes, they are correctly in the array.

But hey, I found what I believe to be the solution!
With the BP above, I was loading the selected level, and unloading the rest, even if they were not loaded.

Apparently, unloading an UNLOADED level has kind of a buggy behavior, so I added an Is Loaded node before to check, and it worked fine!

Thank you for your help!