In what order do Blueprints execute? Do they run in parallel?

For example, I have a Level Blueprint and a PlayerCharacter Blueprint. Both these blueprints have an Event BeginPlay.

When the level is opened, the PlayerCharacter get’s spawned into the level immediately by the Gamemode (it appears this way to me).

My question is, which of these blueprints get prioritized first for running this event? Does the Level blueprint run Event BeginPlay first or does the PlayerCharacter run Event BeginPlay first? Does UE4 treat them as queued events, or do they get run in parallel?

I ask this because I currently have a Level Blueprint that makes a connection to a Parse server in Event BeginPlay. However, it would seem that my PlayerCharacter also runs it’s Event BeginPlay sometimes before the Level Blueprint and others times after the Level Blueprint.

I have scoured the documentation, and found little in this matter. Is there a diagram that showcases which types of blueprints run first, or the order of execution between the various blueprint types and their similar events?

I sincerely appreciate any guidance you can provide me on this topic!

I’m not sure about this, but if I had to make an educated guess I would say the Level Blueprint goes first. What you could do is put a print node at the start of their begin events and see who comes first, then try playing multiple times so you can see if it is consistent or if they swap places now and then.

That sounds like a good idea. I will try that now. Would you happen to know about any official documentation on this sort of information? I believe it’s quite critical to have this written down.

Not sure if they have something like that but they do have a way of controlling the order of tick execution:

Whilst figuring out the order of blueprint execution would be difficult, as it would require someone to poke around in the source code or experiment a lot, what I can suggest is that you attach a variable to the beginplay node of the gamemode/player blueprint, so that it will wait for the level blueprint to finish the task and THEN signal the character to continue.

This could even be moved to a custom event, that way it would not have to be on begin play. The level could do the heavy lifting at start, and then run a custom event on the gamemode or player character. That way you could control the order that the things happen in.

I have not yet read about controlling tick execution, but it would seem that currently in my project the Event BeginPlay does not have a specific order. Quite often, the PlayerCharacter will run it’s Event BeginPlay first and then the Level Blueprint will fire it’s Event BeginPlay. It looks like a manual form of checking needs to be done.

This seems like the most reasonable answer. There seems to be no set order to which the blueprints fire their events, with the exception that we can expect BeginPlay events to come first so long as the objects are spawned for example. It would seem that the current solution is to do manual checking, and communicating between the blueprints. Either through checking public variables, or firing off custom events. Thank you for your answer IcemanX. It is a shame that Unreal Engine 4’s documentation is lacking in this area. Unity3D has this information available here:

I have done some investigations on this topics because after packaging my game: nothing works!

When I use Unreal editor and the menu “Play / select viewport” or “play/ standalone game” my game works well.
The origin of the problem : in the level blueprint of my map I called a function located in my BP_GameModeBase => this does not work when my game is packaged because it seems the BP_GameModeBased is “called” after the map is “called”. I fixed it by using a function in the BP_GameInstance and it work again after packaging.

After that I have done a simple test with the template thirdpersonexample provided with Unreal editor. I have created dedicated blueprint for all the classes and I have add in “event beginplay” a simple “print string”. See the result attached (reminder : with print string the print are done always on the top of the screen, it means that the last line displayed on the screen is the first which is displayed) .

We can see that the order of the execution in play mode and after packaging is not the same and this explains in my case the issue.

I shared my test but I wonder if it is really like that in UE or just a problem of settings somewhere in UE or a problem specific to my PC installation or …?

Tell me if I am wrong or right or the way to fix it…

Thank you!
alt text

1 Like