Unload all streaming levels

Hello everyone,

I made an UI to select which streaming level I want to display.
I am trying to unload ALL streaming levels before I load the one desired.

But it does not work properly :
When I look at my level panels

331836-capture.jpg

When I jump to one of the villas with my UI, some of the others are unloading (this is correct) but some others keep being loaded.
Everything except the one I select from my UI should unload.
When I plug a print in my loop, this is all correct, I see the 3 others streaming levels that should not be loaded, so my loop is good and the problem seems to come from the unload node… I tried to put a delay before the unload, but it does not change anything.

exemple of incorrect behaviour:
1- I start from villaA, only A is displayed : ok
2- I select B : A unloads, B loads : ok
3- I select C : C loads but B does not unloads : not ok
4- I select D : D loads and B and C keep loaded : not ok at all !!!

What should I do? This feature is really needed for performance issue and this is a professionnal project.
Any help will be appreciated.

Thank you.

Get rid of the tick on ‘block on unload’. You can’t use ‘latency’ based node in a loop. The loop doesn’t wait for latency nodes.

ok, so, it must be the reason why it does not unload everything. How should I do then?

OK Thank you very much, you’ve unlocked me.
I’ve changed my method to unload only the previous loaded stream level stored in a temporary variable as I only need 1 loaded at a time. Thx again!

I think you can unload in a loop, just not with ‘block on unload’ checked…

Nope. obviously I tried, and unfortunately it didn’t work. But really, your first answer made me think it an other way and now it’s even more optimized. Thx