I am trying to use level streaming to be able to switch levels without suspending the game. (If this isn’t the best way to achieve this, could you point me towards a simpler/more appropriate approach - I am not making a large open world, just don’t want the game to stop when we change levels).
At the moment, I have by persistent level set up and couple of other levels set up in the same folder with the aim being I can load/unload these on demand. However, they currently all load at once at the start.
This answer suggests that I need to change the streaming method to load from Blueprint rather than automatically load. This wiki tutorial shows this being done when creating a new level via the context menu in the Levels window.
However, in my Levels window the context menu has no such options. Where can I change the streaming mode in Unreal 4.7 (or else how do I achieve loading levels one at a time).
Update
I have been trying to get the following code to work:
ULevelStreaming* StreamingLevel = FLevelUtils::FindStreamingLevel(Level);
if (StreamingLevel)
{
EditorLevelUtils::SetStreamingClassForLevel(StreamingLevel, ULevelStreamingKismet::StaticClass());
}
By executing it on an instance of the level in the editor and then saving it out. This code seems to be what is linked to SetStreamingMethod_Blueprint
in LevelCollectionViewCommands.h:
UI_COMMAND( SetStreamingMethod_Blueprint, "Change Blueprint Streaming Method", "Changes the streaming method for the selected levels to Blueprint streaming", EUserInterfaceActionType::Check, FInputGesture() );