You suggest using the function gui_pick() – where are you seeing this as a valid function? I can find two references to gui_pick() on the internet, both from this forum, but as far as I can tell it has never been a valid function in any version of Godot.
Now that you mention it, I can’t seem to find it either in the current Godot version. I first saw it in this post:
I don’t know if it was removed or replaced, but I remember it being a Viewport method to determine specifically if a Control node is at a given position.
It became a half-hour obsession of mine. An LLM suggested it as a valid function for implementing long press on mobile. Of course I found out it didn’t work. The correct function is get_viewport().gui_get_hovered_control() (which does work on mobile to detect the control under a touch if anyone else was curious). But I spent a long time trying to figure out where it got that from, looking at the docs back to 2.1, googling, searching GitHub, and commanding another LLM to scour the web and explain its wayward sibling.
My theory as to what happened is the LLMs got confused by their training data because Defold, another game engine, has a function called gui.pick_node() that very similarly “determines if the node is pickable by the supplied coordinates.” Then we poor fools picked up the baton and carried it forward. With any luck, this conversation will be picked up in the next update to training data and the loop will close. That, or Godot will need to add gui_pick() function to match the AI view of reality.
Sooooo, I just browsed through Godot documentation versions 4.0 to 4.3 - the versions the LLM says gui_pick() was present - and found no mention of gui_pick(). I also searched the source on Github, and unfortunately could not find any definition of gui_pick(). I guess that previous post I saw was referencing a method suggested by an LLM.
To clear things up: get_viewport().gui_pick() is a nonexistent function in Godot, at least not on any documentation I have browsed so far.