AGameModeBase::StartPlay
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: virtualENGINE_APIUFUNCTIONBlueprintCallable
Description
Triggers the transition from initialization to gameplay by calling BeginPlay on all actors. Override to add pre-game setup that must complete before actors receive BeginPlay.
Caveats & Gotchas
- • This is what actually fires Actor::BeginPlay across the world. If you override it without calling Super::StartPlay(), no actors will receive BeginPlay and the game will appear frozen.
- • In AGameMode (the subclass), this drives match-state changes. In AGameModeBase, it simply calls WorldSettings->NotifyBeginPlay() and then WorldSettings->NotifyMatchStarted().
Signature
UFUNCTION(BlueprintCallable, Category=Game)
virtual void StartPlay() Return Type
void Examples
Override StartPlay to spawn actors before BeginPlay fires
Blueprint
Override to run logic before BeginPlay fires C++
void AMyGameMode::StartPlay()
{
// Spawn initial pickups before any actor receives BeginPlay
SpawnInitialPickups();
Super::StartPlay(); // fires BeginPlay on all actors
} Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?