AGameModeBase::GameStateClass
#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
Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?