I have a problem with an inventory widget I created, when I click outside the panel that its in, either on another part of the screen, or into another widget, it is no longer able to close.
I’ve tried to add ‘set focus’ and ‘set keyboard focus’ to its OnKeyDown event, which removes it from its parent (HUD) when pressed, however that doesn’t seem to work as I’m guessing the focus is on another widget or viewport, therefore the OnKeyDown event doesn’t even get called.
I’m aware that making the canvas panel visible fixes this, as the focus stays on that specific widget always, however, this introduces the problem that I can’t drag and drop items from my inventory widget to my hotbar widget any more.
So I have to choose between having an inventory that loses focus and wont close when I click on my hotbar or not being able to use my hotbar. Any suggestions or solutions would be appreciated.