Widget mouse cursor issue when adding/removing widget

I’m using Unreal Engine 4.6.1 and having the same issue as reported here:

I’m making everything using Blueprints.
So basically when adding a widget or even just setting visibility + setting enabled. I have to click somewhere first to be able to interact with the widget buttons or other parts.

Same happens when I remove the widget from the viewport or even if I try to set it hidden and disable it.
The mouse cursor stays on screen even if the cursor is set to be hidden. Then I have to still click somewhere to get focus and then the mouse disappears and I can again move my character.

Thanks in advance.

Ok guy I solved it.

It works like this:

When you have to show a widget on screen. Use the following node (Set Input Mode UIOnly) assigning to player controller and the widget you’re showing and set the “Lock Mouse to Viewport” to TRUE

Then, when you are hiding the widget or removing it. Use (Set Input Mode Game Only)

I hope this helped you. :smiley:

I have been wondering about this for a long time. I have a questions though. When I use this method, my UI is unresponsive to my clicks. Any idea why?

Hey PhoeniX, thanks for the information, it works, but it only works when you remove the widget using the UI ‘close’ button. What if I want to use the right mouse click to close the widget? I tried it and it won’t work because it only accepts input for UI only.

As for Ky Mercer, I think the only possibility I can think of is that you did not assign the widget to the ‘target’ at the ‘Set Input mode UIonly’.

Also, the problem is already fixed, now we can just use the normal ‘set ignore movement/look’ and it wont have the weird, click after remove widget thing again.