Godot Version
4.7.2
Question
Hellou, I am trying to make a simple drag and drop system with control nodes and I was wondering if one can get all the control nodes under the mouse position.
I know there is the gui_get_hovered_control() but that only gets the top one, or the one hovered rather and that doesn’t really work in my case because I am dragging a control node all over so the dragged control node always gets the hover and so far I didn’t find a way to disable the dragged control to not get hovered:
Since I am making a 3D game I have kind of avoided 2D nodes, I know this can be done via 2D collision nodes but I am curious of different possible approaches and if anyone has any recommendations as to how to approach it etc.
Control nodes have mouse entered and exited signals. As long as the mouse filters for each set as pass (not ignore or stop), you can track when mouse is on each individual control node. So you can do something similar to what you’d do with 2D collision nodes
From your description, it looks like you don’t really need to get all controls under mouse, but instead just disable input for the dragged control.
Hmmm fair enough, but that also seems like a pretty tedious way to go about it, maybe even more tedious than 2D collisions
Yeahhh, but disabling the mouse input doesn’t actually stop the control node from being “hovered”, I still get the draggable icon as the result when I do gui_get_hovered_control().
Hard to help you without seeing how you implemented drag and drop in code.