OnBeginCursorOver and OnClick Issue with UMG

I speculate this is a bug, so I am removing my post from “Using UE4” to post it here.

We have an actor on our map with a cube static mesh. OnClick event for the actor (mesh component actually) doesn’t work. On the other hand, OnBeginCursorOver event… well it kinda works. But it fires not during mouse-hover of the component, but when we click on it. (Both RMB and LMB clicks trigger it). I don’t remember something like this happening in other projects. Have I overlooked some detail? Or is this a bug?

EDIT: Tested again in a new empty project. OnClick and OnBeginCursorOver fire when they are suppose to fire. Either we made an unintentional change in our project or that’s definetely a bug :slight_smile:

EDIT 2: After massive amount of testing, I figured that this is related with one of our Widget Blueprints. I played around with the Widget Blueprint. Only, setting the class to “collapsed” status inverted the issue. Also removing “Create Widget” and “Add To Viewport” nodes for this Widget Blueprint in Level Blueprint did the trick as well. The problem is, this Widget Blueprint has so many children that it will be hard to rescript from beginning.)

EDIT 3:: Further investigating the issue, I noticed that similar things happen in all widget blueprints. When clicking on a mesh through %50 transparent widget, it triggers the OnBeginCursorOver. I don’t exactly know how would I prevent mouse events through widget elements. But based on the logic here, our original Widget Blueprint works as if it is covering the entire screen. It has a Horizontal Box as master instead of Canvas Panel, maybe that can be the cause?

Hello onuryurdupak,

After looking into your issue it appears that this is working as intended. I have provided a link below to documentation that covers visibility with widgets. This appears to be an issue with the settings of visibility for your widgets. You may want to set your widget(s) to “HitTestInvisible” I hope that this information helps.

Link: Slate UI Widget Examples for Unreal Engine | Unreal Engine 5.1 Documentation

Make it a great day

Thank you for your time and response. I read the documentation long ago and those options (their tooltips) actually didn’t make any sense to me :slight_smile: I thought they were like: “Make visible during testing” and such. But probably, at the time I didn’t know what HitTest stood for either :slight_smile:

I have the same problem. I don’t understand why the widgets have to be switched to HitTestInvisible if you want to use them while you are manipulating the actors in the scene. I have a panel that only covers a part of the screen, but this blocks all clicks on the entire screen. Which is the explanation of this behavior? Is not antiintuitive?

As far I know, that should not happen. Check the widget parents, especially the ones that cover the whole screen. If they are set Visible or something, that would explain it. Try setting them to “Self Hit Test Invisible” if that is the case.