# UMG Widget Events broken behavior with mouse interaction

**URL:** <https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766>\
**Category:** UI\
**Tags:** unreal-engine, Widget, question, UMG\
**Created:** [June 6, 2017, 10:33pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766 "2017-06-06T22:33:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raf\_L3O](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raf\_L3O](https://forums.unrealengine.com/u/Raf_L3O)\
**Post date:** [June 6, 2017, 10:33pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/1 "2017-06-06T22:33:51Z")

</div>

In the sample project provided, I have a “Hud” user widget in the viewport when play is pressed. It shows a simple button with multiple layers all marked self-hit-test-invisible except the button. The Hovered/Unhovered and Clicked events are defined for the test.

Expected behavior (works in 4.15.1):

1. On mouse Hovered/UnHovered the button changes color to give feedback
2. On mouse Clicked the button border color changes (acting as a toggle button)

Unexpected behavior (broken in 4.16.1):

1. On mouse Hover the button does not trigger the OnHovered event as you would expect unless you click inside the button at which point the hover/unhovered events work. Clicking inside the button once more stops the events from triggering.
2. On mouse Clicked the button never triggers the OnClicked event to change the border color

Please see attached sample project in 4.15 then migrate to 4.16.1 to compare before and after.

link text

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [June 7, 2017, 8:29pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/2 "2017-06-07T20:29:53Z")

</div>

Hello ,

I believe that this is working as intended and that the issue is actually occurring in 4.15, here’s why.

Your project’s setup in 4.15 has your checkbox at the bottom of the hierarchy, which means that your checkbox is rendered above all other components (See Screenshot\_01). This means if working as intended, the button should not be accessible for events such as hovering or being pressed because the checkbox is being rendered on top of it. This is the behavior that is being displayed in 4.16.

In 4.15, despite the checkbox being rendered on top of your button, the button is still able to register events, this behavior is unintended. When you are upgrading your project to 4.16 this unintended behavior is being corrected in 4.16, this is what is causing the issue you are experiencing in 4.16.

To work around this issue, simply reorder so that your button lower in the hierarchy (screenshot\_02).

Cheers!

 ![190174-screenshot_01.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/6/fd627bd5977a55afab93b62b5228f44e8dbd799b.png)

Image of how Z Order renders

 ![190175-screenshot_02.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/3/56386a7f9126f0f57cf30283c5b20f372300dca6.png)

Image of reordered hierarchy

---

<div class="post-metadata">

**Author:** ![Raf\_L3O](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raf\_L3O](https://forums.unrealengine.com/u/Raf_L3O)\
**Post date:** [June 7, 2017, 8:53pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/3 "2017-06-07T20:53:21Z")

</div>

Hi , thanks for responding.

I think you missed one part in this. The visibility for the checkbox is set to self-hit test invisible, the cursor hit test should be passing through and register the event on the button underneath it. Don’t you agree?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [June 8, 2017, 7:46pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/4 "2017-06-08T19:46:04Z")

</div>

With the setup From your project, I was able to get the expected result by changing the check from “Self Hit Test Invisible” to “Hit Test Invisible”.

---

<div class="post-metadata">

**Author:** ![Raf\_L3O](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raf\_L3O](https://forums.unrealengine.com/u/Raf_L3O)\
**Post date:** [June 8, 2017, 10:15pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/5 "2017-06-08T22:15:12Z")

</div>

Yes I can confirm that but the “Self Hit Test Invisible” should also work.

In a more complex widget you may want the children of the checkbox to register events and setting “Hit Test Invisible” would not work with it’s children.

This sample project was just to demonstrate the issue with 4.16 which is clearly a bug with at least check boxes. Our project uses hundreds of widgets and many rely on this functionality to work correctly.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d2b909bf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d2b909bf](https://forums.unrealengine.com/u/anonymous_user_d2b909bf)\
**Post date:** [June 9, 2017, 4:11pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/6 "2017-06-09T16:11:48Z")

</div>

I am seeing an issue with the checkbox in 4.16 and have logged a report for it here:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-45885)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

---

<div class="post-metadata">

**Author:** ![maljkovicdusan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@maljkovicdusan](https://forums.unrealengine.com/u/maljkovicdusan)\
**Post date:** [February 11, 2019, 1:35pm UTC](https://forums.unrealengine.com/t/umg-widget-events-broken-behavior-with-mouse-interaction/395766/7 "2019-02-11T13:35:54Z")

</div>

Hi Guys,

has anyone solved this issue? I have the same problem with a canvas:

I have 2 widgets, widgetTOP and widgetBOTTOM. widgetTOP has a canvas which is set to self-hit test invisible and my clicks are not going through to widgetBOTTM where all my buttons are.

Thanks,
