RealDocs

AActor::AutoReceiveInput

property Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UPROPERTYEditAnywhere

Description

Specifies which player's input this actor will automatically receive when the game starts, without requiring explicit EnableInput() calls. Set to Disabled to opt out, or to Player0–Player3 to bind a specific local player.

Caveats & Gotchas

  • This sets up input binding at BeginPlay via EnableInput(); it is equivalent to calling EnableInput(GetWorld()->GetFirstPlayerController()) for Player0 — if you need dynamic input binding or need to unbind it, use EnableInput()/DisableInput() at runtime instead.
  • In networked games this only applies on the machine that owns the player — on a dedicated server, AutoReceiveInput for Player0 has no effect because there is no local player 0.
  • The EAutoReceiveInput enum is 1-indexed for player slots (Player0=1, Player1=2, …, Disabled=0) — do not compare against raw integers.

Signature

UPROPERTY(EditAnywhere, Category=Input)
TEnumAsByte<EAutoReceiveInput::Type> AutoReceiveInput;

Example

Configure an actor to receive Player 0 input via Blueprint defaults C++
// In the actor constructor — equivalent to checking Player0 in editor
AutoReceiveInput = EAutoReceiveInput::Player0;
InputPriority = 0;

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.