RealDocs

AGameModeBase::PlayerControllerClass

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

Description

The APlayerController subclass spawned for every player who joins. Set this in class defaults to give players access to custom input bindings and game-specific controller logic.

Caveats & Gotchas

  • Marked NoClear — cannot be set to None. A PlayerController is always required.
  • Changing this during play has no effect on existing players; it only applies to newly joining players. For seamless travel scenarios, also check SpawnPlayerController and GetPlayerControllerClassToSpawnForSeamlessTravel.

Signature

UPROPERTY(EditAnywhere, NoClear, BlueprintReadOnly, Category=Classes)
TSubclassOf<APlayerController> PlayerControllerClass

Example

Read PlayerControllerClass from the active game mode Blueprint
Event BeginPlay Cast To MyGameMode Object Cast Failed As My Game Mode As My Game Mode Is Valid Input Object Is Valid Is Not Valid Get Game Mode Return Value Get Player Controller Class Target is Game Mode Base Target Player Controller Class Player Controller Class
Edit Blueprint graph Read PlayerControllerClass from the active game mode
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.