# How do i make an enemy attack the closest player?

**URL:** <https://forum.makecode.com/t/how-do-i-make-an-enemy-attack-the-closest-player/36717>\
**Category:** Help\
**Created:** [May 16, 2025, 10:45pm UTC](https://forum.makecode.com/t/how-do-i-make-an-enemy-attack-the-closest-player/36717 "2025-05-16T22:45:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 12, 2025, 9:53pm UTC](https://forum.makecode.com/t/how-do-i-make-an-enemy-attack-the-closest-player/36717/4 "2025-06-12T21:53:44Z")

</div>

i made a tutorial on this if you are still interested  
[[Tutorial] Making an Enemy Follow Multiple Sprites :snake:](https://forum.makecode.com/t/tutorial-making-an-enemy-follow-multiple-sprites/33914)

---

_[View the full topic](https://forum.makecode.com/t/how-do-i-make-an-enemy-attack-the-closest-player/36717)._
