Download

Issues with input modes and UI's

Hey guys, I wont link images of blueprints till requested because im really not sure what the issue is. Basically I followed a guide by UnrealGaimeDeveloper on YouTube to build an inventory system, and it works… When it works… You see I have slightly different requirements. For a start, I must have input mode as game and UI because I want to be able to strafe while I loot items. I dont want to be completely static when looting. Now when I did this I ran into the issue where If I clicked off the inventory or through it, it would kill my cursor and I could only rotate when clicking.

I fixed this by adding a canvas panel with visibility and override on on mouse down/up returning handled to ‘eat’ the mouse clicks. Which fixed that. But Its really buggy. For example, if I play the game, and right click, then enter the menu, I dont have any functionality inside, if I take damage then enter the menu, I cant do anything inside. Ontop of that, I added a flipflop node for ‘InputActionInventory’ - pressed which leads to a flip flop. Flip leads to show inventory function and flop to hide inventory function. Now if I press play and hit Tab repeatedly it will open and close the inventory. But if I loot something then open it, I cant close it. If I set input mode to UI only, I cant even use flop at all.

Im really new and have tried a ton of things to fix it, just trial and erroring and testing things as I go by, but Ive been trying while developing things around it for over a week now and I just dont understand what would cause it, maybe this is a common thing and you guys would see what Im missing.

Massively appreciate any advice or input here,

Thanks guys,

Joe

That’s the same as me bar the fact that it’s been over 4 years instead. You’re having issues with this because there is quite a bit to wrap one’s head around.

A bit strange for *take damage *to affect UI functionality. Consider giving the desired UI element *focus *when opening the inventory. Set Input Mode UI Only node has an extra pin that allows focusing on a specific widget. Make sure that the widget root is flagged as IsFocusable.

That’s definitely problem with the logic. Most likely because the input mode has been set to UI only or something else is consuming the input. See below.

That’s the correct behaviour. *UI Only Mode *will prevent the player controller (or anything that’s not a widget) from handling input. Do not use *FlipFlop *here. Open the menu normally, make sure it’s in focus:

To close it, override O*n Key Down *in the widget:


Do note that the widget has to be in focus for this to work and you need to click in the widget’s visible area. Clicking the game world outside of the widget will make it lose focus, for example. To fix that you can force a widget to maintain focus no matter what by:

focusLost.PNG

With this, I’m able to run around, open & close inventory with the same key and run some more. You will need some extra bits and bobs if you need to interact with the world & the UI at the same time.

Thank you so much for this great response, you have really given me some great information more than I expected which has really helped me understand this issue, thank you so much!