How do I make a button receive a click the the player is also using clicks to move

Godot Version



I’m making a mobile version of a game, where the player moves towards touches on the screen. How would I allow the player to click buttons and stuff without the game registering it as a command to the player?

If you are using the Input singleton you can’t easily do that because it always registers the actions. If you are using _input() in your player then move the code to _unhandled_input() More info about the input system Using InputEvent — Godot Engine (stable) documentation in English

Thanks for your solution.
It mostly works, but I’m noticing that when I have it in a
if Input.actuon_pressed block, it follows the mouse around so long as the mouse is being clicked/pressed. It stops following the muse around and just goes to the location where the click happened when I move it into an _unhandles_unput function. Do you know how I could fix this?