Hide Mouse - Widget Confusion

I don’t blame you.

You’ve got 2 things affecting your cursor visibility. A UMG widget and the Player Controller. Even though you asked the controller to hide it, the widget that the cursor is currently over is overriding cursor visibility.

You can test it by executing the code you posted and clicking anywhere outside of the Visible parts of the widget, this will pass the control over the the PC and the cursor should disappear.

In order to hide the cursor for good, even while a widget is in focus, you’d need to ask the widget to do it, too. In this example, the PC is showing the cursor, the border was set to None, and the button was left untouched:

Image from Gyazo

You can do it manually for any widget element in this hidden panel:

246620-untitled.png

Or dynamically, like so:

5 Likes

Ok this is a basic example of the major problem I’m facing. I have absolutely no idea why this Widget Blueprint doesn’t run as intended. I’m almost considering it’s not my fault.

The example above fails to hide the mouse after “Hide Mouse” is printed.

Does anyone else get a different result when replicating?

Thanks for the help in advance, much appreciated.

1 Like

Wow, absolutely incredible!

Thank you Everynone for such a quick explanation of what is really going on and also a detailed solution.

I’ve really learnt something. I hope this thread helps other new people as well.

10/10

I could not get this to work in 4.24, even if I add the stupid thing in tick. :frowning:

EDIT: Apparently a full screen HUD doesn’t count as a widget, and thus doesn’t show the cursor… wtf!?

If this isn’t working, you may need to first use the node from:

PlayerController > SetInputModeGameOnly / SetInputModeUIOnly, etc.

The Input Mode seemed to override any manual cursor settings in my project.

5 Likes

Hey guys, This one worked for me! I hope someone finds this useful. (this is inside my widget bp)

1 Like

I found that with a custom widget cursor I could not get the mouse to hide after detecting game pad input unless I moved the mouse. So when I set the mouse cursor to hidden I adjust the mouse position and then the mouse picks up the hidden attribute.