I’ve set up a menu that is supposed to open and close by pressing the U key on the keyboard. When it opens, the mouse cursor appears and movement/look controls are locked so players are only able to use the mouse. When I hit U again, nothing happens. The keyboard input isn’t being read. It’s supposed to remove the menu and unlock the movement controls so the player can move/look around again.
I’ve tried following the dozens of slightly different tutorials on here, YouTube and Unreal Answers, and none of them seem to solve my problem. I’ve attached pictures of my current setup - the one I thought was most likely to work.
Stepping through doesn’t present any major glaring issues. I did however realize about 20 minutes ago that my OnKeyDown function works, but I have to first press it to re-enable general functionality, then press it a second time to remove the HUD. I also have to click on my slider and keep my mouse hovering over it before it works. That sounds like it’s losing focus to me.
hmm, then i think you can try to remove wire to “in widget to focus”, left it blank, i read somwhere “focus” is something like where your keyboard input goes in (because keyboard can add words only to one “window”), so probably that consume your keypress, but im really not sure
I guess I can also clarify that when I remove the Set Input UI Only node, the toggle works fine without any issues (except the player can also still move and look around, which is super annoying when you’re moving the mouse to click the slider and its also moving the game camera at the same time).
2c: Haven’t had much luck with any of the Set-Input BP nodes.
One workaround is to use Gates triggered by Remote Events.
Basically to shutoff where Inputs shouldn’t go in a given state.
Not what you want to hear maybe, as its more work to code…
But nothing gets filtered / movement can continue if needed!
Obviously check Consume-Input is Ticked-Off where it must be.
To debug add a dedicated Keyboard Event inside each Widget…
Very noticeable where you do things like Pausing the Game etc.
I use Gamepad/Mouse/Keyboard so can’t rely on focus anyway.
The more likely solution is that it simply wasn’t designed that well to begin with :rolleyes:
Guess I’ll drop yet another blueprint in favor of C++. Blueprints are turning out to be the most useful, useless tool I’ve encountered in game development. It’s like they had a great idea and executed it to about 95% quality, but that last 5% has its claws in nearly everything you’d end up needing eventually, and you’re more or less stuck hoping Epic staff responds and makes tickets for you so you can get it fixed in ~2-3 months at best.
However, some of this problem I think might be my own error and I simply haven’t caught it yet - could be the order of my nodes or some race condition I’m unaware of.