Hello, i have a door blueprint that loads a list of levels before opening the door. The system works but when it’s loading the levels it kills my game thread and i have a huge fps drop until it’s loaded. I have specified that bShouldBlockOnLoad is set to false on the LoadStreamLevel call, so that should load on a different thread and do it asynchronously. Here is the code i did:
void ADoor::LoadLevels()
{
FString Callback = "OnLevelLoaded";
for (int32 i = 0; i < Levels.Num(); i++)
{
FName Level = Levels[i];
FLatentActionInfo LatentInfo(0, i, *Callback, this);
UGameplayStatics::LoadStreamLevel(this, Level, true, false, LatentInfo);
}
}