We are building levels where we spawn in Level Instance actors at runtime that have World Partition enabled into a Persistent level that also has World Partition enabled. What we have noticed though that none of the actors that are a part of the level instance stream in and out when playing in PIE for the level you start in. They properly stream if we transition to a different level and back while playing. It also works correctly in Stand Alone.
After some digging, it appears it is related to the call ILevelInstanceInterface::SupportsPartialEditorLoading() returning false if the Persistent level has the PKG_NewlyCreated flag.
ILevelInstanceInterface::SupportsPartialEditorLoading()
// If the level instance actor (or any parent actor) is unsaved, don't partially load. if (Actor->GetPackage()->HasAllPackagesFlags(PKG_NewlyCreated)) { return false; }
However, by default the engine will always add PKG_NewlyCreated to the PlayWorldPackage for the Persistent Level you are starting PIE in
UEditorEngine::CreatePIEWorldByDuplication
UPackage* PlayWorldPackage = CreatePackage(*PlayWorldMapName);
// Add PKG_NewlyCreated flag to this package so we don't try to resolve its linker as it is unsaved duplicated world package
PlayWorldPackage->SetPackageFlags(PKG_PlayInEditor | PKG_NewlyCreated);
Unsure if this is the appropriate fix as there are other places in the Level Instance / Streaming code that check against PGK_NewlyCreated for other reasons, but I was able to get the runtime spawned Level Instance streaming to work in the level you start PIE in with the following change:
ILevelInstanceInterface::SupportsPartialEditorLoading()
// If the level instance actor (or any parent actor) is unsaved, don't partially load. if (Actor->GetPackage()->HasAllPackagesFlags(PKG_NewlyCreated)) { if(!Actor->GetPackage()->HasAllPackagesFlags(PKG_PlayInEditor)) // CHANGE - Exclude PlayInEditor types of NewlyCreated return false; }
In PIE, spawn a Level Instance Actor at runtime and set its world asset.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-295514 in the post.
0 |
Component | UE - World Creation - Worldbuilding Tools - Level Instances |
---|---|
Affects Versions | 5.5 |
Target Fix | 5.7 |
Created | Jun 10, 2025 |
---|---|
Updated | Jun 10, 2025 |