Regardless of whether sublevels are loaded or not, or visible or not - the UWorld
contains an array of ULevelStreaming
objects, one for each sublevel (in the UWorld::StreamingLevels
member variable.)
ULevelStreaming
has SetShouldBeVisible(bool)
and SetShouldBeLoaded(bool)
flags/functions - which are the functions that are called to make a sublevel visible and/or loaded, respectively.
The flags in the Levels detail window of the edtior and the UGameplayStatics::LoadStreamLevel/UnloadStreamLevel
(and bMakeVisibleAfterLoad
parameter) functions call down into these functions of ULevelStreaming
.
Now the question: What does it mean for a sublevel to be loaded but not visible?
During gameplay when I try it (have a sublevel loaded but not visible), I don’t see the actors from the sublevel in the outliner. Does this mean the actors from the loaded but not visible sublevel do not exist in the world? (That seems to be a more extreme state of non-existence than I expected from invisibility.)
What does it mean for a sublevel to be loaded? Like the package file (.umap
file) gets deserialized into memory, but the actors are not spawned in the world?
If you make a sublevel visible, then it spawns the actors into the world? If you make it not visible, then the sublevels actors get destroyed?
Or have I got it wrong?