APawn::DisableInput
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtualoverride
Description
Prevents this pawn from processing player input. APawn's override clears the internal bInputEnabled flag in addition to blocking the InputComponent, ensuring movement input accumulation also stops.
Caveats & Gotchas
- • DisableInput does not clear already-accumulated movement input (ControlInputVector). If the movement component runs after DisableInput is called this frame, it may still consume and apply the buffered input.
- • Calling DisableInput(nullptr) disables input for all controllers and is not automatically re-enabled on possession — you must explicitly call EnableInput again.
Signature
virtual void DisableInput(APlayerController* PlayerController) override; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PlayerController | APlayerController* | The player controller to disable input for. Pass nullptr to disable for all controllers. | — |
Return Type
void Examples
Disable player input when a cutscene starts
Blueprint
Disable input during a cutscene C++
void AMyPawn::StartCutscene()
{
if (APlayerController* PC = Cast<APlayerController>(GetController()))
{
DisableInput(PC);
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?