How is the node execution order determined for Event Begin Play?
I have several Blueprints that all have nodes that fire on Event Begin Play, and some of the Blueprints reference each other during Event Begin Play for data that is initialized during the Event. How is the execution order for Event Begin Play determined? By this I mean, is there any way to know the exact order nodes from different Blueprints will be executed? For example, how can I know the execution order of nodes in my GameState Blueprint that reference the HUD Blueprint, and vice versa. I want to make sure things are executing in the correct order.
asked Aug 06 '14 at 09:06 PM in Blueprint Scripting
Looking on engine source code (which i recommend you to do in this kind of situations, remember that most nodes are representations of C++ functions), BeginPlay is called in direct sequence after SpawnActor, so it called right after actor is spawned. So order of spawn determent order of BeginPlay, or else actors are spawned from different threads then things might looks diffrent.
Here you have stack of calls reaching from SpawnActor to BeginPlay
https://github.com/EpicGames/UnrealEngine/blob/6c0afee5903072d1c20863d86f8decfffaab71f1/Engine/Source/Runtime/Engine/Private/LevelActor.cpp#L325 https://github.com/EpicGames/UnrealEngine/blob/6c0afee5903072d1c20863d86f8decfffaab71f1/Engine/Source/Runtime/Engine/Private/Actor.cpp#L2244 https://github.com/EpicGames/UnrealEngine/blob/6c0afee5903072d1c20863d86f8decfffaab71f1/Engine/Source/Runtime/Engine/Private/Actor.cpp#L2276
Remember that you need to have your github account tied to Unreal account (in profile on main page) to view those links
answered Aug 06 '14 at 11:40 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here