Any predetermined execution order for the begin play events of default classes?
Hi, is there any general predetermined order in which the 'Begin Play' events occur for the default classes like the Game Mode, HUD, Default Pawn, Player Controller, Game State, Level Blueprint and Player State?
asked May 11 '15 at 11:25 AM in Blueprint Scripting
As far as I know they are instant and triggered at the same time, when the level is completely loaded.
I would like a confirm from a more experienced person too. But so far I got many BeingPlay events that are connected to each other on my own game and they are not having any problems. For example my Gamemode does something to my player right away, while my player is giving info back to my gamemode at the same time with both beginplay events. I would have an error if there was an order.
One thing I am not sure is that, if there is an order and it is not obvious when the game is small. For now my game launches in 1 second so maybe I am wrong.
Best way you can check I think is, make Being Play event on all those classes, and connect Print Strings upon them with -different- colors. If the color is randomised everything you launch the game, there is no order. If they are always the same pattern, there is. ^^
I am suuuper late to this question. But one of the things I did is, in my custom character I check if my dependency actor has already been initialized and if it has not then I initialize it. For example, I want AWorldSet actor to have its BeginPlay executed before APSCCharacter is done with its begin play. So I do this APSCCharacter's BeginPlay
Note this only calls BeginPlay for world set once. So you don't have to worry about being play being called twice. Once this execution is complete world set's HasActorBegunPlay() will return true preventing further execution of BeginPlay in the same frame.
Hope that helped!
answered Jul 25 '17 at 05:20 AM
Or have a single level script that gets Ticks, and count a few ticks, then execute functions in all the desired blueprints in some order.
answered May 11 '15 at 03:24 PM
SND R Keene
Why not make the order yourself?
There are many ways to do it. The most simplistic way is, adding delays to each Begin Plays of each BPs.
No Delay = First one to trigger in Game Mode 0.01 Delay = Do something in player BP 0.02 Delay = Do something in player Controller
So it will be guaranteed to happen in order. Surely there are more proffesional ways, but that would be a start I guess. I did that before putting everything into right order so they would work without delays. =)
answered May 11 '15 at 02:54 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here