# Detect 2d object touching 3d raycasting object?

**URL:** <https://forum.makecode.com/t/detect-2d-object-touching-3d-raycasting-object/29011>\
**Category:** Help\
**Tags:** extension\
**Created:** [May 29, 2024, 10:33pm UTC](https://forum.makecode.com/t/detect-2d-object-touching-3d-raycasting-object/29011 "2024-05-29T22:33:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoogerBubbleChunks](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@BoogerBubbleChunks](https://forum.makecode.com/u/BoogerBubbleChunks)\
**Post date:** [May 29, 2024, 10:33pm UTC](https://forum.makecode.com/t/detect-2d-object-touching-3d-raycasting-object/29011/1 "2024-05-29T22:33:42Z")

</div>

Please help, I am using the raycasting extension, and I am attempting to make a spy-shooting game. I just started and am already stuck.  
Projectiles don’t work, because there is nothing that can tell if they overlap another 3d object. I need a way to damage the bot when the bot gets hit, and the player when the player gets hit.

Help would be greatly appreciated.

Here is my project: [https://arcade.makecode.com/S45991-03166-45177-60607](https://arcade.makecode.com/S45991-03166-45177-60607)  
Press A to shoot.

PS. I’m new, I don’t really know how to post, please tell me if I’m posting in the wrong category or any other rules 🙂

---

<div class="post-metadata">

**Author:** ![pecan4pi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pecan4pi/32/20940_2.png) [@pecan4pi](https://forum.makecode.com/u/pecan4pi)\
**Post date:** [May 31, 2024, 1:01pm UTC](https://forum.makecode.com/t/detect-2d-object-touching-3d-raycasting-object/29011/2 "2024-05-31T13:01:06Z")

</div>

4 things.

1. Welcome @BoogerBubbleChunks! 😃
2. Great game so far, the art is super good.
3. You **did** post in the correct category. I totally get why you were/are concerned about it; I was too when I made my first post.
4. the problem has a simple fix that’s hard to find if you don’t know what to look for (I’ve also had this problem before). You need to put the “is sprites `sprite` and `othersprite` overlaps in z dimension” block into an if statement, then throw those into the standard overlap block. In all theory, this should work. If it doesn’t/if you need more in general help, feel free to ping me. 🙂  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/91fa60bd2a78abbfede2474991a3004bf004c11b.png)

Can’t wait to see how the game turns out  
-pecan4
