Unable to pick up mouse_entered signal when area2d is child of canvas layer?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stubbsy345

I have some area2D’s as a child of a canvas layer. For some reason, when the child of a canvas layer the mouse entered signals no longer work. Does anybody know why this is?


Maybe that’s a bug? Do you have a minimal reproduction project?

Zylann | 2018-04-05 01:08

I’m pretty sure it happens with any area2d collision shape when set as a child of a canvas layer tbh.

stubbsy345 | 2018-04-05 16:58

I am having this same issue. I am trying to check if mouse is over HUD with Area2D but is not working so far.

thiago | 2018-04-16 20:57

1 Like
:bust_in_silhouette: Reply From: bitwes

Check that the parent is not stopping the mouse.

It isn’t. The scene works fine when working by itself. But won’t work when as the child of a canvas layer. (I instance the scene onto a canvas layer from within the main game).

stubbsy345 | 2018-04-05 16:57

Can any of the other objects get mouse events. Also, I might not have been explicit enough in my answer. I meant to check that the parent object doesn’t have its mouse_filter property set to MOUSE_FILTER_STOP.

It might be worth making a simple example and linking it here.

bitwes | 2018-04-06 01:43

:bust_in_silhouette: Reply From: luislodosm

An expanded Control node can block the mouse to lower nodes.

Check if there is a Control node inside the CanvasLayer and change the property mouse_filter to Ignore.