Hello everyone,
I try to stream in Level Instances into my persistant level via the ULevelStreamingDynamic::LoadLevelInstance, it works very well in the editor and my map segments appear albeit in a random order they appear at the right position with the right rotation. Now I want to access the levelbounds actor of each map. However when I try it I am unabel to get a reference to the level.
Relevant Code:
Dynamic Level Streaming
ULevelStreamingDynamic::LoadLevelInstance(GetWorld(), pLevelName, pMapTransform.GetLocation(), pMapTransform.GetRotation().Rotator(), succ);
GetWorld() returns a reference to the persistant level. The LoadLevelInstance practivally calls world->addStreamingLevel()
Thats why i am expecting the following code to work.
auto StreamingLevels = GetWorld()->GetStreamingLevels();
for (int i = 0; i < StreamingLevels.Num(); i++) {
auto levelData = StreamingLevels.GetData()[i];auto actors = levelData->GetLoadedLevel()->Actors.Num();
}
However LevelData contains bad data. Where only the first of the 8 Objects is not NULL. Albeit that object is entirely corrupted with the aforementioned bad data.
Hopefully someone has a similar idea and can help me.