Left clicking on widget deselects it...

I have a widget that contains a background, some buttons, a few status bars etc. This widget is suppose to show the stats of a particular character. I have it set up so when you de-select the actor that owns the widget such as left clicking outside of it, it will hide the widget.

My issue is that the widget gets hidden when I click on anything ON the widget that is not a button. Can anyone give me any advice?

I made sure that everything in my widget is set to visible and can interact with mouse.

I tried using “Is hovered” which always ends up displaying as true anywhere on the screen. Because of that I tried setting the canvas panel of the widget to “desired” so it does not encompass the entire screen, only the widget.

I have tried doing the “event mouse enter” and “event mouse leave”, within the widget, but when I bool check it, it always comes out as true even if my mouse is not inside, or hovering over the widget it turns true anywhere on the screen.

I tried comparing the viewport location of the widget with my mouse’s current position and it still deselects it.

I tried setting the widget’s z authority to like 1000 and it still does it.

It appears to happen on almost all of my widgets, if there isn’t a button and I left click on a widget, my collapsing event happens when it should only happen when I manually de-select the actor or click in the world space around it.

I also notice I can give my character a right click move command through the widget. If you were to right click on a widget it shouldn’t tell the character to move to that location that is UNDER the widget.

See attached video and screenshots, please let me know what else I can provide to assist in solving this. I am pretty sure I have the game and UI widgets set up properly as well as I can interact with any widget, if it has a button…




I have a scroll box with a black border in the background (The border is set to Visible when displayed and I collapse it when I click outside of it).

Designer:
Anything that shouldn’t get clicked set the visibility to Not Hit-Testable (Self Only).
Like the text or that white square so the mouse click will ignore it.

Select the background border in your widget and on Events OnMouseButtonDown click Create Binding and after the function is setup add it to OnMouseDoubleClick also
(My fuction was named On_Border_Help_MouseClick, yours will be named after your background border or whatever you used for the background).

Graph:
In the function add a “Handled” to the return value.

1 Like

You are an absolute genius thank you so much that worked, sorry for late reply had a few emergencies try to stop me from working in UE5. Thanks again!!