Prevent unloading of level in world composition

Hi, Im using world composition for streaming levels.

In certain locations of the map, the player can click and start a minigame. For easy of use the minigame is actually placed far away in an unused location of the world composition in the persistent level.

The problem is that when I move the camera to the minigame location, the current level the player is in its unloaded. This causes a loading time when the player exits the minigame. I change camera with “set view target with blend”.

I would like to avoid streaming levels to unload the level where the character is when the camera moves away. Is there a way to disable unloading of a specific level? (BP or C++)

How can I set this programmatically at runtime? I will have to disable that for the current level when I launch the minigame and move the camera, then re-enable it again when minigame is finished

Hello! There is Disabled prop on Level Streaming Volume, do you try to use it?

I solved it by setting bDisableDistanceStreaming=1 , client side on all the levels which are actually streamed in.

Here is sample code for it:

TArray<ULevelStreaming*> levels = me->GetWorld()->GetStreamingLevels();
for (int i = 0; i < levels.Num(); i++)
    levels[i]->bDisableDistanceStreaming = 1;

You will have then to re-enable when the minigame exists.