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:
You can do it manually for any widget element in this hidden panel:
Or dynamically, like so:
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.
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.
I could not get this to work in 4.24, even if I add the stupid thing in tick.
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.