Adding a comment to this thread because I’ve had the same issue
If the mouse cursor is visible, even if you’re set to input mode Game Only and not UI or Game+UI, clicking in the viewport at all will deactivate the viewport as the current receiver of mouse events. From then on, your mouseX and mouseY values will be zero unless you click and hold a mouse button.
The code driving this is in SceneViewport.cpp and, if you want to disable this behaviour, the code to modifiy is:
bReleaseMouseCapture =
bCursorVisible ||
ViewportClient->CaptureMouseOnClick() == EMouseCaptureMode::CaptureDuringMouseDown ||
( ViewportClient->CaptureMouseOnClick() == EMouseCaptureMode::CaptureDuringRightMouseDown && InMouseEvent.GetEffectingButton() == EKeys::RightMouseButton );
I commented out the “bCursorVisible ||” part and it works as expected for me beyond this, but there’s likely a more nuanced fix (maybe a check for if you’re in UI mode) that supports all expected input modes.