UMG Widget Events broken behavior with mouse interaction

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

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!

Image of how Z Order renders

Image of reordered hierarchy

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?

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”.

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.

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

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.

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,