# How to make enemy to track and shoot you

**URL:** <https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088>\
**Category:** Arcade\
**Created:** [April 4, 2024, 9:44pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088 "2024-04-04T21:44:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmqwyuio](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@pmqwyuio](https://forum.makecode.com/u/pmqwyuio)\
**Post date:** [April 4, 2024, 9:44pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/1 "2024-04-04T21:44:24Z")

</div>

Can anybody help me to mae the character to shoot back (I have failed multiple times)  
Here is the code: [https://arcade.makecode.com/S51985-84363-70683-34482](https://arcade.makecode.com/S51985-84363-70683-34482)  
I have seen other people with the same problem but they don’t work

(I will credit you when finished)

---

<div class="post-metadata">

**Author:** ![CopySprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/copysprite/32/35475_2.png) [@CopySprite](https://forum.makecode.com/u/CopySprite)\
**Post date:** [April 9, 2024, 2:19pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/2 "2024-04-09T14:19:18Z")

</div>

I can do it.

---

<div class="post-metadata">

**Author:** ![pmqwyuio](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@pmqwyuio](https://forum.makecode.com/u/pmqwyuio)\
**Post date:** [April 9, 2024, 11:23pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/3 "2024-04-09T23:23:21Z")

</div>

ok thanks

---

<div class="post-metadata">

**Author:** ![CopySprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/copysprite/32/35475_2.png) [@CopySprite](https://forum.makecode.com/u/CopySprite)\
**Post date:** [April 10, 2024, 12:22am UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/4 "2024-04-10T00:22:42Z")

</div>

Your welcome and I’ll report when it works.

---

<div class="post-metadata">

**Author:** ![pmqwyuio](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@pmqwyuio](https://forum.makecode.com/u/pmqwyuio)\
**Post date:** [April 15, 2024, 5:10am UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/5 "2024-04-15T05:10:27Z")

</div>

I need it ASAP I am sorry for any inconvinience

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [April 15, 2024, 4:35pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/6 "2024-04-15T16:35:31Z")

</div>

Check out [Coder king 3: legends - #411 by Luke](https://forum.makecode.com/t/coder-king-3-legends/19667/411) I have some enemies which shoot at you and kinda strafe around and those which just follow

---

<div class="post-metadata">

**Author:** ![CopySprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/copysprite/32/35475_2.png) [@CopySprite](https://forum.makecode.com/u/CopySprite)\
**Post date:** [April 15, 2024, 4:46pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/7 "2024-04-15T16:46:59Z")

</div>

I’m really sorry this is taking so long it’s just I have other things to do such as collabs and I don’t really understand raycasting. but other than that ok ASAP it is. 🚀

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [April 15, 2024, 9:33pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/8 "2024-04-15T21:33:41Z")

</div>

> **[Enemy Shooting and Retreating](https://arcade.makecode.com/S73612-39889-47385-86475)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I don’t really do 3D but hopefully this can be helpful

---

<div class="post-metadata">

**Author:** ![pmqwyuio](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@pmqwyuio](https://forum.makecode.com/u/pmqwyuio)\
**Post date:** [April 16, 2024, 5:05pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/9 "2024-04-16T17:05:50Z")

</div>

thanks very much

---

<div class="post-metadata">

**Author:** ![CopySprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/copysprite/32/35475_2.png) [@CopySprite](https://forum.makecode.com/u/CopySprite)\
**Post date:** [April 16, 2024, 6:22pm UTC](https://forum.makecode.com/t/how-to-make-enemy-to-track-and-shoot-you/28088/10 "2024-04-16T18:22:42Z")

</div>

Sorry I couldn’t do 3d.
