Download

Ways to guarantee blueprint construction order?

Hi everyone. I was wondering if anyone knew a good way to control the order of execution of blueprint classes in ue4? It seems the order is sort of random within ue4 itself as in some projects the order of construction is something like pawns, gamemode, level and in others its gamemode, level, pawns etc. I want to guarantee order so that I don’t have to worry if my constructed pawns and other things will be created before they need to be used by other blueprints. Any help is appreciated. Thank you.

You cannot and that is big problem with construction scriot. They generally are executed in order you put them into editor, but that is not guaranteed (ie. may be totally different in standalone game).

Well that just seems silly. The more I dig into ue4 the more I feel like it’s not very programmer friendly.

What I like to do, is instead of using Construction scripts or “Begin Play” nodes, create an “Init” custom event that you can call after another dependent blueprint has finished its stuff. So the GameMode has its own things to handle on Begin Play, then it call Init on the Player Controller, which calls Init on the Pawn, then calls Init on each of the dependent blueprints, etc. This way you can explicitly say what gets initialized when and by what.

Hmm, I’ll see if I can implement something like. Thanks Jared.