# Crash when using raycast to see if hit Game Object

**URL:** <https://forum.defold.com/t/crash-when-using-raycast-to-see-if-hit-game-object/608>\
**Category:** Questions\
**Created:** [December 11, 2015, 3:47pm UTC](https://forum.defold.com/t/crash-when-using-raycast-to-see-if-hit-game-object/608 "2015-12-11T15:47:46Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Johan](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/johan/32/127_2.png) [@Johan](https://forum.defold.com/u/Johan)\
**Post date:** [December 11, 2015, 4:49pm UTC](https://forum.defold.com/t/crash-when-using-raycast-to-see-if-hit-game-object/608/5 "2015-12-11T16:49:03Z")

</div>

That is because action.x and action.y is in screen space and the raycast is in world space. In order to determine if a game object is clicked or not, here is one of may threads discussing the topic:

> [@Click on game object](https://forum.defold.com/t/click-on-game-object/461):
>
> Hi guys! I’m struggling with a simple concept: detect if a og has been clicked. Now I’m using on\_input, but the event is dispatched even if I click outside the om itself… Any idea to solve this?

---

_[View the full topic](https://forum.defold.com/t/crash-when-using-raycast-to-see-if-hit-game-object/608)._
