RealDocs

APawn::AutoPossessPlayer

property Engine Since 4.6
#include "GameFramework/Pawn.h"
Access: public Specifiers: UPROPERTYEditAnywhere

Description

Specifies which local player (if any) automatically possesses this pawn when the level starts or the pawn is spawned. Set to Player0 for the typical single-player or split-screen primary player.

Caveats & Gotchas

  • This only works for local players — it has no effect in a multiplayer listen server scenario for clients. For dedicated server or net-spawned pawns, possession is always handled explicitly through GameMode or AController::Possess.
  • If both AutoPossessPlayer and AutoPossessAI are set, AutoPossessPlayer takes priority and no AI controller is spawned.

Signature

TEnumAsByte<EAutoReceiveInput::Type> AutoPossessPlayer

Example

Auto-possess by player 0 in the constructor C++
AMyPawn::AMyPawn()
{
	AutoPossessPlayer = EAutoReceiveInput::Player0;
}

Version History

Introduced in: 4.6

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.