AGameModeBase::GameState
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: UPROPERTYTransient
Description
The live AGameStateBase instance for this session. Stores replicated game-wide data accessible on both server and clients via UWorld::GetGameState.
Caveats & Gotchas
- • Accessing GameState directly from game mode code is fine, but call GetGameState<T>() to avoid manual casts and get compile-time type safety.
- • Marked Transient — not serialized. It is always recreated from GameStateClass when the map loads; do not try to persist data here across level transitions.
Signature
UPROPERTY(Transient)
TObjectPtr<AGameStateBase> GameState Tags
Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?