AActor::DisableInput
#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
Disable input when player leaves interaction range C++
void AMyInteractable::OnPlayerExitRange(APlayerController* PC)
{
DisableInput(PC);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?