Which one first running Game Mode, Player Controller, Character or Level?

which one first running Game Mode, Player Controller, Character or Level ?
i need to know which process fire’s first.
because i have soo many “Cast To blabla” nodes.
I need to know real processing order about unreal classes
i mean which “Begin Play” runs first?

Game Flow Overview | Unreal Engine Documentation

this is probably reference you seek ^

1 Like

begin play wise very easy to check just printing some on each:

image

  • Actor
  • Gamemode
  • Level BP
  • Player Controller
1 Like

Agree with @AntiGravity . If you need to prioritize in terms of which BeginPlay() fires first, there’s very probably ample room for improvement in the way your classes are organized. A hint that might be relevant: if you need for Object B to know about Object A, do not have Object B query for Object A (ie. B search for some of A’s properties in its BeginPlay – issue: the query might happen before Object A actually exist), rather have Object A register itself to Object B or to a global registry (in its BeginPlay, Object A says to whom needs to know “Hey, I exist now!”).

This said, I found this video extremely helpful in understanding Unreal’s game framework
priorities:
(337) The Unreal Engine Game Framework: From int main() to BeginPlay - YouTube

Hope that helps!

Cheers

f

2 Likes

Generally a good piece of advice. However, IF it is uncertain whether A comes before B or B before A, your approach can fail, too. If that was the case, both should make themselves know to the other. OR, and this is the case regarding the game mode, you know, by definition of the unreal engine, that one certainly exists before the other. Then your approach works.

you can make a looping check like this:

I have not found any issue with this so far.