How to disable mouse movement input on launch?

When starting (in Standalone Game mode) the player controller moves with the mouse movement. This should not happen, as the mouse movement should only occur if the right mouse button is pressed.

Similarly, keyboard inputs should only be accepted when the right mouse button is pressed. This works fine, the keyboard input is ignored.

The mouse is also correctly handled after I use any of the mouse buttons once, so there is probably some start up option that enables mouse movement on begin play or something.

I know that in the Project Settings there is the “Capture Mouse on Launch” option, but disabling that did not fix the issue. Chaing the “Default Viewport Mouse Capture Mode” (even to No Capture) does not help either.

Therefore: how do you disable mouse movement input on launch?


Edit:

Calling DisableInput(this); in the player controller class does not fix the issue either, the player controller still moves with the mouse until I click once.

In your Character try to use GetController()->SetIgnoreMoveInput(true) and GetController()->SetIgnoreLookInput(true)

Try to play with these functions, I think You might be able to get desired behaviour with them :slight_smile:

This of course will not disable the input itself, but will prevent player controller from moving your character.