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