Hey,
When I show the mouse cursor by default with bShowMouseCursor = true and somewhere in the game hide it with bShowMouseCursor = false, to get back the infinite Mouse Axis input, the cursor it is limited to the screen…
What should I do, to get the infinite axis input(don’t limit it to the screen)?
There are three input modes I know of:
- FInputModeUIOnly
- FInputModeGameOnly
- FInputModeGameAndUI
FInputModeGameAndUI has “SetLockMouseToViewport”
Just an idea.
As info, my code looks like this:
void
YourClass::allowInputGameAndUi()
{
FInputModeGameAndUI inputMode;
inputMode.SetLockMouseToViewport(false);
inputMode.SetWidgetToFocus(nullptr);
inputMode.SetHideCursorDuringCapture(false);
FSlateApplication::Get().SetUserFocusToGameViewport(0);
APlayerController* pPc = GetWorld()->GetFirstPlayerController();
pPc->SetInputMode(inputMode);
}
i’ve already tried that, but then the mouse InputAxis doesn’t receive any input.
the input then is always 0.0 for Mouse.X and Mouse.Y
The exact same problem here, when I temporarily disable mouse cursor in my game, I want to be able to rotate my scene around a pivot point, but bShowMouseCursor prevents it.