Order of events while starting the game

Guide for people who don't read C++, explaining what happens

Updated over 4 years ago

Explain more events...

  • Game Instance::StartPlayInEditorGameInstance calls UWorld::BeginPlay.

  • UWorld::BeginPlay

    • GameMode->StartPlay()

      • AGameStateBase::HandleBeginPlay()

        • GetWorldSettings()->NotifyBeginPlay()

        • GetWorldSettings()->NotifyMatchStarted()

      • AWorldSettings::NotifyBeginPlay()

        • This calls BeginPlay on the actors currently existing in the world. Order of called actors is unknown (i.e. not deterministic), therefore any game logic executed at runtime cannot rely on Actor X calling BeginPlay before Actor Y.
    • GetAISystem()->StartPlay()

    • OnWorldBeginPlay.Broadcast()

    • PhysicsScene->OnWorldBeginPlay()

This helps keep the lights on