Every widget can control cursor behaviour like so:
You’d set it to None for elements you wish not to display the cursor. The feature is well hidden in an Advanced Panel indicated with a white downward facing arrow.
Do tell if you get it to work the way you need. There could an exception where the widget has no focus and simply does not know where the cursor is. But then the controller’s Show Mouse Cursor bool node would suffice.
Just one more thing, would be recommended to create all the widgets within the HUD class instead of create the widgets inside different blueprint (eg: player controller class, actor class)?
Because now I have to change the mouse cursor behaviour on each of my widget bps
There is a reason why one would want that but that has more to do with managing all widgets in a single framework class accessible from anywhere in your code - can be nifty. And the HUD has some cool functionality you can’t get anywhere else.
Because now I have to change the mouse cursor behaviour on each of my widget bps
You’d still need to set it up for every widget anyway, I think.
Once you flag the root’s cursor as None, the children (buttons, border, text) will respect that or can override it. So you could play with this programmatically:
Give each widget an interface, fetch them all and set their cursor to none. Or call it for every widget that you create. But that’s already a lot of clicking.
Perhaps you could create an empty, blank widget with the cursor set to none and have all other widgets inherit from that:
This will now become a default setting for the root. But that’s as much clicking as setting it manually.
Another way:
Create a widget that is transparent and use it as a cursor.
At this point I’m not sure if you do not want mouse-widget interaction or simply want to hide the cursor but be able to interact with widgets. Perhaps you can just make the root not hit testable:
At this point I’m not sure if you do not want mouse-widget interaction or simply want to hide the cursor but be able to interact with widgets. Perhaps you can just make the root not hit testable :
I just want to hide the OS cursor
@Everynone thanks a lot, you are a wonderful person! Really appreciate all the help