RealDocs

AGameModeBase::GameStateClass

property Engine Blueprint Since 4.14
#include "GameFramework/GameModeBase.h"
Access: public Specifiers: UPROPERTYEditAnywhereNoClearBlueprintReadOnly

Description

The AGameStateBase subclass this game mode spawns and replicates to all clients. Every project that stores custom replicated game data should point this at a custom subclass.

Caveats & Gotchas

  • Marked NoClear — it cannot be set to None in the editor. Always keep a valid class assigned.
  • The GameState is replicated to all clients; data you put on it is automatically available everywhere. Put server-only state on the GameMode instead.

Signature

UPROPERTY(EditAnywhere, NoClear, BlueprintReadOnly, Category=Classes)
TSubclassOf<AGameStateBase> GameStateClass

Example

Print the active GameState class name on BeginPlay Blueprint
Event BeginPlay Print String In String Game State Class Game State Class Game State Class Get Object Name Target is Object Object Return Value Return Value
Edit Blueprint graph Print the active GameState class name on BeginPlay
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.