# Getting a weapon to follow the nearest enemy

**URL:** <https://forum.makecode.com/t/getting-a-weapon-to-follow-the-nearest-enemy/32391>\
**Category:** Help\
**Created:** [December 11, 2024, 6:40pm UTC](https://forum.makecode.com/t/getting-a-weapon-to-follow-the-nearest-enemy/32391 "2024-12-11T18:40:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Holderify](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@Holderify](https://forum.makecode.com/u/Holderify)\
**Post date:** [December 11, 2024, 6:40pm UTC](https://forum.makecode.com/t/getting-a-weapon-to-follow-the-nearest-enemy/32391/1 "2024-12-11T18:40:28Z")

</div>

How do I get my weapon to follow the nearest enemy?  
[Game](https://arcade.makecode.com/S16920-59983-66720-33026)
