How do i unload a sublevel or array of sublevels at the press of a button?

Hey there, you can do this. Just bind a key to that.

Then just create a variable of type array name and do a for loop and execute the Unload node for each name.

yea that doesnt work. I seen a bunch of other answers posts on this… it literally breaks the loop.

Can you show a screenshot of what you are trying?

How do i unload a sublevel or array of sublevels at the press of a button?

that doesnt work for an array of levels… it only works for 1 level… i cant get an array to work…
I can get an array to toggle visibility , but have yet to get it to unload…

honestly i already deleted it since streaming levels via blueprint freezes for too long… But there are other answerhub post about that. Same principal streaming a bunch of levels in an array. Able to make it work for visibiliy, but load level or unload level doesnt work for more then 1 at a time…

My goal here is to get as much fps as possible by hiding all levels that are not seen. Though im having other issues with performance there… as in it doesnt save me much fps in stand alone play mode… yet it does save me tons of performance when i simply hide the level in the editor… not sure why that is… Like i can literally hide every single level in standalone play mode… and i get maybe a 5 fps boost… so at 0 draw calls im at 55fps on a gtx 980… which makes no sense at all…

If you want to hide you can get the streaming level and set should be visible to false.

Your not understanding… i have no problem hiding levels… My problem for some reason is hiding them in standalone play mode does not increase performance… I can hide all of them in stand alone play mode and i barely get any extra fps… In the editor my fps skyrockets past 200 fps if i have 0 drawcalls… in stand alone play mode i hide every level and have 0 draw calls and im stuck at 55 fps… Any ideas why that is?

This is one of the reason i tried unloading levels instead… which an array for hiding levels in a for loop doesnt work and kills the loop… But i realize that unloading and loading levels isnt a real option either due to a severe lag spike…

So again… im not really understanding why the performance issue if every single level is hidden in “stand alone play mode”

This is me starting the level with literally all other levels unlaoded except the sky level and a couple of volume levels for post process and culling… As you can see I included stat scene rendering as well…

again fps should not be 55 on a gtx 980 with 2 draw calls…

No nothing in my persistant level… at all… As you can see we only have 2 draw calls… this is just being stupid and no one at epic seems to try to tackle this problem…
But again… the fps in the editor is much better if i hide everything via the level windows tab… Its only when i play it in a stand alone run play mode … that it just sucks for performance…

Try stat levels in the console to see if they are unloaded properly. If they unloaded you have to have a huge fps boost.

Yeah it’s weird, do you have a lot of stuff in the persistent? You can try to create a new very simple level and just use that one with your game mode to see what happens.

Just endulge me by creating a very simple level and set how it performs.

Empty levels seem to perform fine, but i will do it again tomorrow just to make sure. Did you want me to create a new persistant level and add all those sublevels to it?

Yes the goal is to slowly go towards what you have right now and figure out what is the step that breaks everything.

brand new empty level maxes out at around 240 fps. tried adding the sublevels back everything into a new persistant level instead… and with every level unloaded on play im still maxing out at 56 fps…

Also I sent you a private message on unreal forums :slight_smile:

Just found that if i dont load the post process volume and lightmass importance level… the fps max makes it to like 120 fps when levels are hidden… which is interesting but very confusing… what in the post process could cause that? Most of the graphical things are limited… like removing the ssreflections

update so i have narrowed it down to the post process volume, but why would the post process volume hurt performance in standalone but not in the editor view??

update2

convulted bloom switched back to regular bloom seems to give back the performance boost of hiding levels… weirdest thing… who knew u lose 70fps from using convulted bloom… bug?