Why Axis Value of MoveForward event is 0 when left mouse button event?

What is mapped to MoveForward and what are you trying to achieve?

I want to implement the function of moving the character position with the left mouse button

Hope it helps:

image

1 Like

This is a problem with how your player controller settings are treated in the engine, in the SceneViewport. Apparently if you combine the playercontroller settings "bShowMouseCursor " set to true and the input mode set to “Game”, the viewport will lose focus each time you lift any mouse button, resulting in the axis value reading 0 and breaking your controls.
This is something which has been discussed over the years but no one came up with a fix.

I modified quite a few things in my project, but from memory my workaround to be able to use the mouse in input mode game, is to re apply the input mode whenever the bug triggers:
PlayerControler, on event any key:

if (bShowMouseCursor && InKey.IsMouseButton() && (InEventType == EInputEvent::IE_Released) && (InputMode == E_PlayerControllerInputModes::Game)) {
	// Simply re-applying the Game input mode seems to do the trick.
	ActivateInputModeGame();		
}
4 Likes