Detect if mouse is in a 2D area with buttons

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

I’m trying to make a menu with buttons. The menu is supposed to stay hidden by default, then pop up once you mouse over it and stay in place until the mouse exists the area.

I’ve tried using a control node, an area2d, and a button for the hover detection. All those methods work around the buttons but don’t work in the areas the button overlaps (triggering mouse exit and mouse enter when the mouse goes over a button).
Setting mouse filter to pass doesn’t seem to change anything (in any of the nodes) and setting it to ignore effectively disables the node as it’s only meant to accepts mouse input.

Detecting the mouse position from within a script is easily doable but I want to use nodes.

enter image description here

Is there a way to set an area that detects mouse hover, with clickable buttons inside the detection area, just using nodes?

:bust_in_silhouette: Reply From: CassanovaWong

I sometimes make a mouse nodea area2D… that is always at the position of the mouse… and use it with get_overlapping_bodies/areas also, you can use more than one collision shape in your nodes and detect the individual shapes of the collison bodies/are as