I got actors like spawn points for players and other actors which get unloaded from World partition.
All actors inside my data layer have “Spatially Loaded” set to false. Also the data layer is set to Runtime and have “Initial Runtime state” set to activated. If I’m not mistaken this should be all steps necessary to make my actors always loaded. So I can work with them via get actor inside my game mode.
But sadly thats not the case here. I discoverd that those actors still behave like they set to “Spatially Loaded” and only get activated/loaded if I’m near one of those actors. I also tried to force the data layer to activated inside my game mode, with the blueprint call on the data layer subsystem, but also with no results.
This behavor only shows when I play in standalone mode and doesn’t occur when I play in viewport or even in a multiplayer session. I’m kinda frustrated with this and have no idea why unreal does this.
So my guess is, I miss something why world partition behaves this way or Unreal doesn’t like me. xD
Any ideas why this can still happen or perhaps even a alternative solution to ensure all those actors are loaded no matter the distance?
P.S. I work with unreal engine 5.4 and the world partition was setup inside unreal engine 5.3. I added the data layers afterwards inside 5.4.
After searching even more inside the world partition logs I have found something interesting, unreal seems to confuse something with my actor.
This is the log entry of world partition when I execute it inside the viewport:
- Guid:CD32052B4878AD40002533B6AC60F640 BaseClass:/Game/Interactables/Pages/APageRegion.APageRegion_C NativeClass:/Script/Engine.Actor Name:APageRegion_C_UAID_701AB82A73F2E70F02_1367040001 Label:APageRegion SpatiallyLoaded:0 Bounds:IsValid=true, Min=(X=89500.000 Y=890.000 Z=1240.000), Max=(X=89700.000 Y=1090.000 Z=1440.000) RuntimeGrid:None EditorOnly:0 RuntimeOnly:0 HLODRelevant:0 ListedInSceneOutliner:1 IsMainWorldOnly:1 HLODLayer:/Game/HLOD/HLOD_NoSpatially.HLOD_NoSpatially
That is what I expect from my settings and everything is fine.
But now to the standalone mode log entry:
- Guid:CD32052B4878AD40002533B6AC60F640 BaseClass:/Game/Interactables/Pages/APageRegion.APageRegion_C NativeClass:/Script/Engine.Actor Name:APageRegion_C_UAID_701AB82A73F2E70F02_1367040001 Label:APageRegion SpatiallyLoaded:1 Bounds:IsValid=true, Min=(X=89500.000 Y=890.000 Z=1240.000), Max=(X=89700.000 Y=1090.000 Z=1440.000) RuntimeGrid:None EditorOnly:0 RuntimeOnly:0 HLODRelevant:0 ListedInSceneOutliner:1 IsMainWorldOnly:0
I don’t know why but unreal seems to set it to spatially loaded.
After some more research I found out that it works when I package my project.
So I guess its a bug from unreal to set actors to spatially loaded in standalone mode.