Input mode game only with show cursor complications

Hi! For my game I need a visible cursor to interact with the world space, with no UI present. My problem is in input mode game only when the cursor is shown any mouse input events applied to the world space hide the cursor and seemingly change the input mode. The alternative of setting the input mode to game and ui appears to correct the issue however with input mode game and ui any mouse movement only incurs input events or input updates (axis mappings, action mappings, get mouse x/y, etc) when a mouse button is held.
My current solution is to set input mode game only and set show mouse cursor on start, then with every mouse button input event set input mode game only. This solution feels inadequate, any suggestions?

Just don’t change the input mode

2 Likes

not designating an input mode causes two problems. First: after start keyboard inputs will not register in the player pawn blueprint, and the mouse cursor rendered will be the default software cursor despite successfully assigning a different current mouse cursor in the player pawn blueprint, until an initial mouse input on the viewport. this is with the correct viewport properties project settings and enabling input in the player pawn on BeginPlay.

Second: for some reason when playing the game when set show mouse cursor is false the mouse tracking axis mappings sometimes are limited to the viewport as if a cursor is visible. I.E. when set ShowMouseCursor is true while tracking left on the x axis GetMouseX will return negative values until the mouse cursor reaches the left perimeter and then from there tracking left any more will only return zero. Im experiencing this same result even with set ShowMouseCursor false, at times.

I wonder if theres some C++ somewhere, or multiple places, I can edit to fix everything. but for the time being it appears I will have to designate the Input Mode. is there any way to change the game and ui input mode to allow mouse tracking to register in the player pawn blueprint at all times?

I don’t know a good solution. You’re either controlling the pawn, or able to point at things. I don’t think you can both :frowning:

I dont have an answer, but this may be of interest:

Custom Game Only Input Mode in Code Plugins - UE Marketplace (unrealengine.com)

motivation here:
Problem with Set Input Mode Game Only node - Superyateam Gamedev

1 Like

thanks BIGTIME! I actually never encountered the issues listed in either the article or plugin page. I wonder if those bugs are fixed on the current ue5 build.
Currently input mode game only does everything I’m looking for. Sticking with input mode game only I’m expecting to need to use scripting like what was shown in the superyateam article to restrict mouse button inputs from some of their current effects to fix the issue.
As long as no bugs hatch from the current settup that is too much work for a minor performance optimization. However in rare cases Im sure they will. To be continued

The misery continues. It’s an ancient problem with the viewport.
I explained it here:

2 Likes