RealDocs

AActor::DisableInput

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

Description

Removes this actor from the input stack of the specified PlayerController, stopping it from receiving input events. Pass nullptr to remove from all controllers at once.

Caveats & Gotchas

  • This does not destroy or clear the InputComponent — bindings are preserved and will become active again if EnableInput is called later. To fully reset input bindings, clear the InputComponent manually.
  • Passing nullptr removes the actor from every PlayerController's stack simultaneously. Be careful when multiple local players are present: this affects all of them.

Signature

ENGINE_API virtual void DisableInput(class APlayerController* PlayerController)

Parameters

Name Type Description Default
PlayerController APlayerController* The PlayerController to stop receiving input from. Pass null to stop receiving input from all PlayerControllers.

Return Type

void

Examples

Disable player input when the player leaves interaction range Blueprint
Event Actor End Overlap Other Overlap Info Other Overlap Info Other Actor Is Valid Input Object Is Valid Is Not Valid Disable Input Target is Actor Target Player Controller Player Controller Get Player Controller Player Index 0 0 Return Value
Edit Blueprint graph Disable player input when the player leaves 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
Disable input when player leaves interaction range C++
void AMyInteractable::OnPlayerExitRange(APlayerController* PC)
{
    DisableInput(PC);
}

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.