All actors are part of the same streaming level.
Thanks.
If you have a basic level with no level streaming, there isn’t really a point in checking if stuff is loaded or not because from BeginPlay
onward you can be sure everything is loaded and ready (as far as the engine logic is concerned).
If you’re using dynamic level streaming, maybe this screenshot has some clues on how to catch the exact moment a sublevel is fully loaded in.
Either way, if neither is sufficient, we’d need some more details on what exactly you’re trying to do because “all actors in a level” sounds specific, but isn’t specific enough.
World Composition, World Partition, Level Streaming… Single Player, Multiplayer (dedicated, Listen)
Details matter.
Sorry, should’ve said level streaming. When a streaming level finished loading.
I’m trying to run code on some of the actors immediately after the level loads completely, for which I need data from other actors.
All actors I’m concerned about are part of the same streaming level.
My game is single player, if that matters.
Broad answer for “Check if ALL ACTORS” are loaded would be to do a World sized overlap → Get overlapping actors, then do a Loop check. If you know the exact number there should be, then just compare the count.
(All overlapped actors -> Length) == Num
If there’s a specific list then give them all custom Actor Tag.
Get all Actors with Tag
, then check length and/or specifics
With world partition/composition you might run into actors outside your current grid/stream distance not being loaded. World Comp streams sub levels based on a streaming distance.
Almost sounds like you’re trying to configure a mess of actors based on the specific state of the game or the level. If so I’d create a class dedicated to doing so and have each of the random actors just interface a class specific event in the configurator class.
Make the configurator class persistent so it loads regardless of stream level or grid.
As each of the other actors load they Get Actor with Tag
or get all actors of class (config class)
, then call the BPI message, passing a self reference.
Implement the BPI event in the config class.
- Event for X class check in (Actor, Data) → Do for X → Call BPI on X → Pass Data
- Event for Y class check in (Actor, Data) → Do for Y → Call BPI on Y → Pass Data
- Event for Z class check in (Actor, Data) → Do for Z → Call BPI on Z → Pass Data
Config class actor could be a placed actor. Anything it would normally get passed during spawn or pre spawn could be pulled on begin play from a data table or save game slot.