APawn::EnableInput
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtualoverride
Description
Re-enables input processing for this pawn after it was disabled. APawn's override also sets the internal bInputEnabled flag, which is separate from the InputComponent's block state.
Caveats & Gotchas
- • The pawn must still be possessed by a controller for input to actually work — enabling input on an unpossessed pawn has no visible effect until possession occurs.
- • APawn tracks input enabled state with an internal bInputEnabled flag (not directly accessible) in addition to the base AActor InputComponent block. Calling EnableInput sets both, but only the PlayerController-specific block is cleared on the InputComponent.
Signature
virtual void EnableInput(APlayerController* PlayerController) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PlayerController | APlayerController* | The player controller to re-enable input for. Pass nullptr to enable for all controllers. | — |
Return Type
void Examples
Re-enable player input when a cinematic ends
Blueprint
Re-enable input after a cinematic C++
void AMyPawn::OnCinematicEnd()
{
if (APlayerController* PC = Cast<APlayerController>(GetController()))
{
EnableInput(PC);
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?