UE4 4.27: I am using different software cursors depending on what the cursor is hovering over. When hovering over an active button in a widget the cursor gets a specific shape assigned to it. This is all working fine. The problem is this: When I don’t press the button in the widget, the cursor shape changes as designed. As soon as I press the button, the software cursor goes to “Default” and makes no further adjustments (whether or not I am hovering over the widget button or over something else on screen). As soon as I press the button again somewhere outside the widget, the cursor shape goes back to what it is supposed to be according to the allocated cursor. I have set Print commands to check that even after hitting the button on the widget, the player controller blueprint where I am setting the cursor, passes the point where I change the cursor widget and it does. But it seems as though after pressing a button on the widget, the node that changes the software cursor doesn’t work anymore. Any idea how to fix this?
Hi there @Wink3319. Hope you’re well!
This topic has been moved from International to Programming & Scripting: Blueprint.
When posting, please review the categories to ensure your topic is posted in the most relevant space.
Thanks and happy developing!
Hey @Wink3319!
Would you mind sharing your blueprints with us so we can get a better understanding of what’s going wrong? Additionally, are you using both “On Hovered” to set your correct cursor, and “On Unhovered” to reset after the cursor leaves the widget?
Hi there!
On my widget, I have the buttons for which I do “On hovered” and “On unhovered”, I cann an event on the player controller with a boolean:
On the Player Controller, I am setting the boolean:
And based on the Boolean for “Hovered” I check each Tick if I need to have the Shape for “Hoeverd” or one of the other shapes (which I decide by looking what else under the cursor if “Hovered” is false:
The strange thing is this: BEFORE I press any button on any Widget, it all works well. I always get the shape that I am looking for depending on what is under the mouse. Just, when I press the button, it stops working and only starts working again, when I click somewhere other than on a button.
I hope the blueprint part is helpful.
Hey @Wink3319!
Maybe I am missing something here. Is there a reason why you trying to set your cursor on event tick rather than when hovering over the widget itself using the built in functions? I don’t seem to be getting any issues using a similar but more direct setup.
Does your cursor require being changed outside of the widget blueprint?
Hello @Quetzalcodename !
Thank you for your help! The reason I am doing this on Tick at the playercontroller is that I am changing the cursor not only when I am hovering over a widget but also when I am hover over a selectable character or over the Navigation mesh or over an object which is neither Navigation Mesh, selectable character or widget (or a pressable button on a widget to be precise). It is the differentiation of Nav Mesh and non-selectable object that I didn’t find a different way to differentiate between. But yes: I need to press on the widgets but also on objects in the 3D world and I want to change the shape of the cursor for either way.
I hope this is understandable.
Alright @Wink3319,
That definitely makes sense. However, that does complicate things significantly. I do get the same error when copying your setup and trying to force everything through the player controller. However, when keeping widgets and hovered object separate, things seem to work smoothly as intended. It may be that it clicks through and gets stuck somehow when forcing the widgets through the controller, but I am not sure why as of yet.
Breaking:
Everything working: