RealDocs

APlayerController::SetInputMode (Game Only)

function Engine Blueprint Since 4.5
#include "GameFramework/PlayerController.h"
Access: public

Description

Switches input routing so that all input goes exclusively to the game (player controller and pawn) with no Slate/UMG widget focus. The mouse is captured by the viewport. This is the default mode during normal gameplay.

Caveats & Gotchas

  • Does not automatically hide the cursor — call `SetShowMouseCursor(false)` separately if needed.
  • Internally calls the single `SetInputMode(const FInputModeDataBase&)` overload with an `FInputModeGameOnly` struct.

Signature

void SetInputMode(FInputModeGameOnly InData)

Parameters

Name Type Description Default
InData FInputModeGameOnly Input mode struct; configure via SetConsumeCaptureMouseDown if needed.

Return Type

void

Examples

Return to pure game input after closing a menu C++
PC->SetShowMouseCursor(false);
PC->SetInputMode(FInputModeGameOnly());
Blueprint equivalent text
"Set Input Mode Game Only" node on the player controller reference

Version History

Introduced in: 4.5

Version Status Notes
5.6 stable
5.0 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.