RealDocs

AActor::EnableInput

function Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTIONBlueprintCallablevirtual

Description

Pushes this actor onto the input stack of the given PlayerController so it can receive and respond to input events. Creates the InputComponent if it does not already exist.

Caveats & Gotchas

  • This does not automatically bind any actions — after calling EnableInput you still need to set up bindings on InputComponent. The function only makes the actor eligible to receive input.
  • Input priority on the stack matters: actors pushed later receive input first. If you have multiple actors receiving input, be aware that one consuming an event will block actors lower in the stack.

Signature

ENGINE_API virtual void EnableInput(class APlayerController* PlayerController)

Parameters

Name Type Description Default
PlayerController APlayerController* The PlayerController whose input stack this actor should be pushed onto.

Return Type

void

Examples

Enable player input when the player enters interaction range Blueprint
Event Actor Begin Overlap Other Overlap Info Other Overlap Info Other Actor Is Valid Input Object Is Valid Is Not Valid Enable Input Target is Actor Target Player Controller Player Controller Get Player Controller Player Index 0 0 Return Value
Edit Blueprint graph Enable player input when the player enters interaction range
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Enable input on an interactable actor C++
void AMyInteractable::OnPlayerEnterRange(APlayerController* PC)
{
    EnableInput(PC);
    InputComponent->BindAction("Interact", IE_Pressed, this, &AMyInteractable::Interact);
}

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.