HUD blocking mouse over evnets. Help!

Ok, the problem is when my HUD is active (added to viewport) “Mouse over events” do not work, and i have to click on an Actor to run “Mouse over events”. And if i remove my HUD - “Mouse over events” works just perfect.

Any tips, pleeeeease? Because im losing my mind :3

Mouse over events are enabled, collision set up as Block All, Trace channel is Pawn.

Didnt Help

If you used a Canvas widget for UI elements placement, it will consume mouse input. Ensure the root element of the widget has the visibility set to SelfHitTestInvisible.

If it’s still not working, post your widget hierarchy.

2 Likes

Ow yeah, it helped. Thank you sir!

It is set by default, but it does not work for me.

What does not work?

Perhaps another widget element is intercepting the input - run widget reflector and see what the cursor is interacting with - the easiest way to find out.

1 Like

Just in case anyone runs into this issue. UI widgets will block mouse over events by default even if you don’t have any button or panels blocking the input. To get around this when setting the visibility use “ESlateVisibility::SelfHitTestInvisible”. This will allow all of your buttons to work while not blocking mouse input for mouse over events. For instance:

HUD->AddToViewport();
HUD->SetVisibility(ESlateVisibility::SelfHitTestInvisible);

Making a diablo like game and this allows me to mouse over loot and highlight it without interfering with the HUD.

2 Likes

Do you know if this can be done with blue prints and in UE5?

The problem is a setting in your widget blueprint details panel, possibly for each element in your hierarchy of widgets. Start from the first item (the blueprint name) and check that under “Behavior”, the “Visibility” dropdown is set to: "Not Hit-Testable (Self Only).
Go through each element in your widget hierarchy and if you do not want it to affect the mouse hovering feedback, set it to the above. As the canvas element covers the whole screen, set it to the above.

1 Like