RealDocs

AGameModeBase::DefaultPawnClass

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

Description

The pawn class spawned when a player joins or restarts. The most commonly customized class property on a GameMode — set it to your main character Blueprint.

Caveats & Gotchas

  • Can be null to prevent automatic pawn spawning. When null, players will be spectators until a pawn is manually possessed.
  • Override GetDefaultPawnClassForController() instead of this property when different player types (bot vs human) should receive different pawn classes.

Signature

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Classes)
TSubclassOf<APawn> DefaultPawnClass

Example

Read DefaultPawnClass to manually spawn the pawn on BeginPlay Blueprint
Event BeginPlay Spawn Actor From Class Target is World Class Spawn Transform Return Value Default Pawn Class Default Pawn Class Default Pawn Class Make Transform Location (0.0, 0.0, 0.0) (0.0, 0.0, 0.0) Rotation (0.0, 0.0, 0.0) (0.0, 0.0, 0.0) Scale (1.0, 1.0, 1.0) (1.0, 1.0, 1.0) Return Value
Edit Blueprint graph Read DefaultPawnClass to manually spawn the pawn 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.