Disable Mouse Cursor Completely

Here is my problem. I have “Show Mouse Cursor” disabled in my Player Controller, but whenever I interact with a widget(like a button) the mouse cursor becomes visible.

  1. One solution I have found is by calling the Set Keyboard Focus function whenever I interact with a widget that has “is focusable” disabled. This spits out a warning each time you do it though, so its not exactly ideal.
  2. The best solution I have found so far is by setting the Cursor variable on the button widget to None and set the Input Mode to Game Only and then back to Game and UI each time I interact with a widget. I have to do the latter part of this solution or else the cursor will be visible when I move the mouse off the button. This isn’t ideal but its a relatively easy fix.

My question is, is there a better or more proper way of completely hiding the mouse cursor when interacting with widgets?

Maybe try to do sometging in blueprint that once button is clicked the mouse cursor is immediately hidden again

That is what I’m currently doing and will continue to do unless I find a better solution. It just feels like kind of a hacky solution and I’m just asking if anyone knows of a better solution than the ones I mentioned above.

According to this question:

You need to do this:

You need to go GetPlayerController → bSetMouseCursorVisible = false when the second map starts, probably in hte level BP BeginPlay event to keep it simple.

Please mark this as the answer if it fixed your problem.