AGameMode::InitGame

Initialize the game.

Choose your operating system:

Windows

macOS

Linux

Warnings

  • this is called before actors' PreInitializeComponents.

Override Hierarchy

AGameModeBase::InitGame()

AGameMode::InitGame()

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/GameMode.h

Include

#include "GameFramework/GameMode.h"

Source

/Engine/Source/Runtime/Engine/Private/GameMode.cpp

Syntax

virtual void InitGame
(
    const FString & MapName,
    const FString & Options,
    FString & ErrorMessage
)

Remarks

Initialize the game. The GameMode's InitGame() event is called before any other functions (including PreInitializeComponents() ) and is used by the GameMode to initialize parameters and spawn its helper classes.

: this is called before actors' PreInitializeComponents.