The widget has “Is focusable” set to true.
What happens is that it fires in fullscreen as intended. However, I don’t get the event and when I press buttons I can hear my character move, jump in the background. And sure enough if I close the widget I can clearly see that the character was moving around. What am I doing wrong?
I guess you’re refering to using “Set Input Mode UI Only” instead of “Set Input Mode Game And UI” but I see no difference in using either. I can move my character in both cases.
Can you explain why you are removing the widget here? Or perhaps describe briefly what the general goal is? I’m assuming we’re dismissing a menu, right?
I guess you’re refering to using “Set Input Mode UI Only” instead of “Set Input Mode Game And UI” but I see no difference in using either. I can move my character in both cases.
I am confused. With UI Only, the player controller would be unable to process input - the inputs in the PC / Pawns / Actor would not work. But above you’re setting Game Only - this means giving the PC full control. Seems contradictory to what you’re attempting to achieve.
Think about the order of operations. If we’re in Game Only mode and try to give widget keyboard focus and only then change modes, it may not work. Perhaps give widget keyboard focus after changing from Game Only → Game and UI.
I’m showing the widget when you get into a trigger. Then I want it to close when you press space and do nothing if you input anything else. It’s a fullscreen widget so I don’t want the character to move.
I’m destroying the widget in OnKeyDown when you press space as I want to close it then. Should I implement it in a different way?
The setting of Input to GameOnly inside OnKeyDown is to restore input to PC after the widget closes.
I’ll try changing the order of keyboard focus!
EDIT:
for the example you provided - I also tried this. Print is not called and if I set breakpoint on it, it never gets called.
I’m destroying the widget in OnKeyDown when you press space as I want to close it then. Should I implement it in a different way?
I’d change the order, Remove after switching to Game Only. Probably irrelevant here but safer in the long run.
A bit odd, that’s the default behaviour. Wondering what else is going then. Can you explain how the very first pic is triggered? What fires that logic?
I’m showing the widget when you get into a trigger.
Can we see that? What are the chances more than 1 widget is created?