I have a 3D game with a traditional 2D HUD. The player needs to be able to click on things both in the 3D world and on the 2D HUD, but I don’t want to treat HUD clicks as clicks on 3D objects that are behind the HUD.
What’s the best way to tell whether a given set of cursor coordinates is over any visible Control objects, so that I can skip the logic for handling clicks on the 3D world when the player is interacting with the HUD?
Input Event processing works in a way, that for Control nodes _gui_input is called and later for CollisionObject3D nodes the function _input_event is called.
So if you receive a mouse event in a Control node of your HUD, and you set the event as handled ( Viewport.set_input_as_handled), then the event does not reach the 3D-nodes.