Detect Latest Receiver Of Mouse Input Event

Godot 4

Is there a way to detect which node in the entire scene tree received the latest input - in my case the mouse - from the user? I am trying to debug a issue where something in the scene tree is blocking some of my buttons from receiving mouse input, so a command telling me when I press something what the latest node that received input from the mouse was would help me debug it.

Does a similar command exist? I tried searching for ‘mouse’ and ‘cursor’ in the engine and also did multiple searches online and only came up with people trying to check a specific node, opposed to finding out which one in the scene tree received it.

Thanks.

There is gui_get_hovered_control(), which returns the Control node. that the mouse is currently over.

1 Like

Thank you! After a bit of fighting with getting the viewport I was able to get it working.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.