# Pathfinding players

**URL:** <https://forum.makecode.com/t/pathfinding-players/36390>\
**Category:** Help\
**Created:** [May 5, 2025, 5:20pm UTC](https://forum.makecode.com/t/pathfinding-players/36390 "2025-05-05T17:20:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ocarmo6819](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ocarmo6819/32/24725_2.png) [@ocarmo6819](https://forum.makecode.com/u/ocarmo6819)\
**Post date:** [May 5, 2025, 5:20pm UTC](https://forum.makecode.com/t/pathfinding-players/36390/1 "2025-05-05T17:20:56Z")

</div>

im trying to make a game with the pathfinding and im trying to make it pathfind a player and not a location. also it will only pathfind the player if it is within like 20 tiles or smth. also im not using the follow block

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 5, 2025, 9:15pm UTC](https://forum.makecode.com/t/pathfinding-players/36390/2 "2025-05-05T21:15:52Z")

</div>

You can do this with the a-star extension! Just paste the GitHub link into the extension search bar!

> [@Tilemap Path Finding ( a\* ) (beta)](https://forum.makecode.com/t/tilemap-path-finding-a-beta/1846):
>
> This extension can be used to find the shortest path between two points on a tilemap, and to make a sprite follow that path. This could be useful in situations like a tower defense game, where you have enemies that need to move along a path from the start to the end. Quick note that this extension is definitely in a ‘beta’ form; the blocks ‘work’ but may change after trying it out a bit more / there may be more additions. Also, I’ll almost definitely change how the path following works; right n…

---

<div class="post-metadata">

**Author:** ![ocarmo6819](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ocarmo6819/32/24725_2.png) [@ocarmo6819](https://forum.makecode.com/u/ocarmo6819)\
**Post date:** [May 7, 2025, 4:14am UTC](https://forum.makecode.com/t/pathfinding-players/36390/3 "2025-05-07T04:14:44Z")

</div>

i know that the pathfinding extension can move between points but is it possible to make the sprite that is pathfinding to pathfind a player instead of 2 points

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 7, 2025, 6:43pm UTC](https://forum.makecode.com/t/pathfinding-players/36390/4 "2025-05-07T18:43:44Z")

</div>

Just put in the player x/y as the point to be path-found(?) to! If it requires a tilemap position there’s a “tilemap position of (mySprite)” block. Then you just update the a\* code every so often in a loop so that when the player moves it updates correctly.

---

<div class="post-metadata">

**Author:** ![ocarmo6819](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ocarmo6819/32/24725_2.png) [@ocarmo6819](https://forum.makecode.com/u/ocarmo6819)\
**Post date:** [May 8, 2025, 8:55pm UTC](https://forum.makecode.com/t/pathfinding-players/36390/5 "2025-05-08T20:55:53Z")

</div>

Ok Thanks!
