# Detecting click zone on game object (like gui.pick\_node) (SOLVED)

**URL:** <https://forum.defold.com/t/detecting-click-zone-on-game-object-like-gui-pick-node-solved/1684>\
**Category:** Questions\
**Created:** [April 26, 2016, 8:30am UTC](https://forum.defold.com/t/detecting-click-zone-on-game-object-like-gui-pick-node-solved/1684 "2016-04-26T08:30:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Andreas\_Jirenius](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/andreas_jirenius/32/114_2.png) [@Andreas\_Jirenius](https://forum.defold.com/u/Andreas_Jirenius)\
**Post date:** [April 26, 2016, 8:59am UTC](https://forum.defold.com/t/detecting-click-zone-on-game-object-like-gui-pick-node-solved/1684/2 "2016-04-26T08:59:09Z")

</div>

Hi  
there is no equivalent with gui.pick\_node but there are of course several ways to do this.  
Two easy things that pop in mind is to  
1: Check the distance between click and gameobject like this in on\_input:

```
local pos = go.get_position()
local distance = vmath.length(vmath.vector3(action.x, action.y, pos.z) - pos )
if distance < 40 then do_stuff() end -- where 40 is the radius of clickarea

```

2: Create collisionobjects on the gameobjects you want clickable and also create an “invisible” gameobject with a collisionobject that checks for collisions with the others.  
Then you could just move the invisible gameobject to the input position and recieve collision messages and handle the clicks whenever these messages occur. Edit: naah.. I would prefer the first one 😉

---

_[View the full topic](https://forum.defold.com/t/detecting-click-zone-on-game-object-like-gui-pick-node-solved/1684)._
