When I hold W (moving forward) and press a widget button my player character (Third person template) stops, and the button does not work, until I press it again. This does not happen if I am normally walking though, only if im jumping AND I started holding down the W-Key before i pressed the space button.
In other words, I must have jumped before I press W to move, then it works. So something with my jump might mess things up.
Also, if I am at the menu and hold leftclick on the widget button, my character slows down untill he stops. If I let go (complete the “press of leftclick”) he starts moving again.
Even if I remove “input mode UI only” the character stops (the button im holding is “not pressed” even if it is). Ill keep playing around with it but this is strange, im probably missing something.
This issue may be resolved a few ways depending on your situation. Here is what I think may be going on here. If your mouse is made visible while interacting with the widget this will stop axis input from the mouse.
Regarding the W key think of this as a one off event that turns to positive 1 when pressed and 0 when released if you click on a widget this input get set to 0 and you must press the W key again to reset it back to 1.
Yea, at this point I figurated the second part out. Now I am searching the exact line in code where it loses it. The widget gets all of the control through function static void SetInputMode_GameAndUI(APlayerController* Target, UWidget* InWidgetToFocus = nullptr, bool bLockMouseToViewport = false, bool bHideCursorDuringCapture = true); The funny part is that if I press to move while in widget and then click mouse hero doesn’t lose input. So I assume that the previous input remains until new come and if widget can’t use it then it try level lower because if I click to move in some direction then he moves and after click at widget hero doesn’t stop.
But even if I detect which keys were pressed I can’t simulate clicking them, right?
To solve the issue of a keyboard input getting interrupted you need to uncheck “Is Focusable” in the details panel for the button inside the Widget BP. (see screenshot)
Thank you! I was trying to figure out why my player kept stopping when they pressed on a UMG widget button inside their inventory. It was frustrating because if the player was running away from enemies and opened their inventory to drink a potion they would stop and the enemies would catch up and kill them. This solves my issue so the player keeps moving while pressing the buttons inside the inventory.