RealDocs

APlayerController::SetShowMouseCursor

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

Description

Shows or hides the hardware mouse cursor over the viewport. When `true`, the OS cursor is visible and can interact with Slate/UMG widgets. Prefer this over directly setting `bShowMouseCursor` as it properly triggers related state.

Caveats & Gotchas

  • Cursor visibility is separate from input mode — a visible cursor does not automatically enable UI input; combine with `SetInputMode` for full cursor-driven UI.
  • In multiplayer, this is a local-only call with no replication.

Signature

void SetShowMouseCursor(bool bShow)

Parameters

Name Type Description Default
bShow bool true to show the OS cursor, false to hide it.

Return Type

void

Examples

Show cursor and switch to game-and-UI input C++
APlayerController* PC = GetWorld()->GetFirstPlayerController();
PC->SetShowMouseCursor(true);
PC->SetInputMode(FInputModeGameAndUI());
Hide cursor and return to game-only input C++
PC->SetShowMouseCursor(false);
PC->SetInputMode(FInputModeGameOnly());

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable
5.0 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.