How can I limit the area where the player's button is pressed?

I wrote a script that if the player clicks on the left mouse button, the player can open the chest. But at the moment, the player can interact with the chest by clicking on the entire area of the screen. I would like to limit the space. by clicking on which the player can open the chest, and not so that he can interact with it, I click on any area of the screen. How can I limit this mouse click interaction (the center of the player’s device screen)

You could put a collision box around the chest and test against the mouse.

You could check the distance from the mouse click to the chest coords, the distance from the player to the chest, or other things. For that matter, you could check the range from the mouse click to the screen center.

If you could post screenshot, it might help visualize the problem.

U could use an area 2d for something maybe that the action only happens when the click is in the area2d node, You should probably add a screenshot or your code for as much context as possible