# Stop Path Following

**URL:** <https://forum.makecode.com/t/stop-path-following/3930>\
**Category:** Help\
**Created:** [October 17, 2020, 9:35am UTC](https://forum.makecode.com/t/stop-path-following/3930 "2020-10-17T09:35:44Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 17, 2020, 6:27pm UTC](https://forum.makecode.com/t/stop-path-following/3930/41 "2020-10-17T18:27:38Z")

</div>

Any Good News about the code? Btw I still have no Idea on how to refill 🤔 😅

---

<div class="post-metadata">

**Author:** ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)\
**Post date:** [October 18, 2020, 6:40am UTC](https://forum.makecode.com/t/stop-path-following/3930/42 "2020-10-18T06:40:27Z")

</div>

I will make Mira HQ  
I think ur replies are refilled  
I play among us

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 18, 2020, 7:05am UTC](https://forum.makecode.com/t/stop-path-following/3930/43 "2020-10-18T07:05:47Z")

</div>

> [@DahbixLP](#):
>
> I need help with stopping the path following extension.

Do you still need help with this?  
I am trying to understand what the issue is. Are you having an issue with this code?

let Path\_Green = scene.aStar(tiles.getTileLocation(87, 59), tiles.getTileLocation(55, 67))  
scene.followPath(Green, Path\_Green, 30)

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 8:19am UTC](https://forum.makecode.com/t/stop-path-following/3930/44 "2020-10-18T08:19:24Z")

</div>

Yes I still need help! So you might know Among Us… A murder mystery game… anyways Green goes to a point of the map by using the path following extension… when I am the murderer and kill him while he is walking his dead body will just slide along… I want it to stay there where I killed Green! Any ideas to make him stop?  
Thanks  
(This is my second account because I dont know how to refill my replys)

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 18, 2020, 12:33pm UTC](https://forum.makecode.com/t/stop-path-following/3930/45 "2020-10-18T12:33:46Z")

</div>

I don’t know what to do. sry. I looked at all the blocks and can’t find out how to stop the sprite. I think I have one idea tho. You can make velocities onto the sprite instead of making a path for it and then if hes dead, you can stop its velocity instead of making a path sprite

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 1:35pm UTC](https://forum.makecode.com/t/stop-path-following/3930/46 "2020-10-18T13:35:09Z")

</div>

Thanks for your ideas and your help! I might also have an idea but I would need your help. To delete the old sprite and create a new sprite there where the guy was killed. I tried it before but since a sprites position is not a vaid number or position… Like:  
Create Sprite (image) of kind (corpse)  
set (corpse) to position (green)  
But it did not work… I would appreciate it if you could help me there (if you have an idea on how to set a sprite on top of another sprite)! Thank you for the help and everything!  
Maybe another member has an idea? Without the path following the people just stand there and its boring… I could do something like in the Sneaking around School Game but then the floor would look bad and the code is giant…

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 18, 2020, 1:37pm UTC](https://forum.makecode.com/t/stop-path-following/3930/47 "2020-10-18T13:37:40Z")

</div>

I just set the sprite to follow to the tile it’s on at speed 0. Works for me.

Sorry for the horrible images, I’m on a phone right now and my phone too small. 😕

 ![Screenshot_20201018-093021](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/0b5cdb59efa705675987787a84552909dcd8cc67.png)

 ![Screenshot_20201018-093048](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/874203a87a2d478c3ab9c3a13be700c3b99029af.png)

 ![Screenshot_20201018-093110](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/26f7ade0781e01c30448dc99661bed65c5fdd0e4.png)

The green `location of sprite` blocks are from the `tilemap` extension.

So the code would be something like:

```auto
sprite follow path from tile sprite on to tile sprite on at speed 0

```

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 1:39pm UTC](https://forum.makecode.com/t/stop-path-following/3930/48 "2020-10-18T13:39:29Z")

</div>

Thanks a lot I will try it now!

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 1:48pm UTC](https://forum.makecode.com/t/stop-path-following/3930/49 "2020-10-18T13:48:29Z")

</div>

I cant find the  
(sprite) data (text) as sprite  
where is it?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 18, 2020, 1:59pm UTC](https://forum.makecode.com/t/stop-path-following/3930/50 "2020-10-18T13:59:34Z")

</div>

Oh, sorry, forgot to say, that you should replace the `sprite data text as sprite` with your sprite that you want to stop the path following.

That was from a project I’m currently working on.

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 2:09pm UTC](https://forum.makecode.com/t/stop-path-following/3930/51 "2020-10-18T14:09:27Z")

</div>

Well thanks but it does not work… either I delete him on overlap (so I removed it)  
Now if I kill him he will not follow his path… but he slides along until he hits a wall  
Thanks anyways  
Ok well he actally runs into a wall… even if he is alive…

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 18, 2020, 2:32pm UTC](https://forum.makecode.com/t/stop-path-following/3930/52 "2020-10-18T14:32:13Z")

</div>

I think @UnsignedArduino used the sprite data extension. I don’t recall seeing any blocks relating to the sprite data extension. When you click the button where you can add extensions, just search for sprite data

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 2:33pm UTC](https://forum.makecode.com/t/stop-path-following/3930/53 "2020-10-18T14:33:37Z")

</div>

I already have that extension and he said I dont need it thanks though

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 18, 2020, 2:34pm UTC](https://forum.makecode.com/t/stop-path-following/3930/54 "2020-10-18T14:34:15Z")

</div>

oh ok. I have bad memory sometimes. I always forget to do them.

---

<div class="post-metadata">

**Author:** ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)\
**Post date:** [October 18, 2020, 2:34pm UTC](https://forum.makecode.com/t/stop-path-following/3930/55 "2020-10-18T14:34:50Z")

</div>

I do rubiks cubes all the time and its hard for me to keep track of all the algorithms

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [October 18, 2020, 3:26pm UTC](https://forum.makecode.com/t/stop-path-following/3930/56 "2020-10-18T15:26:15Z")

</div>

I think you are setting a sprite to follow a path of tiles. In that case, it could be that once you have set the action, removing the action may not be possible. I’ve noticed for certain functions that once you set things it is not always possible to remove it. If that is the case, it might be better to destroy the sprite and recreate it.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [October 18, 2020, 4:00pm UTC](https://forum.makecode.com/t/stop-path-following/3930/57 "2020-10-18T16:00:51Z")

</div>

Well, I was using it, but just replace it with the sprite you want to stop path following.

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 4:12pm UTC](https://forum.makecode.com/t/stop-path-following/3930/58 "2020-10-18T16:12:40Z")

</div>

I know but how do I put a sprite ontop of another sprite?

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [October 18, 2020, 6:22pm UTC](https://forum.makecode.com/t/stop-path-following/3930/59 "2020-10-18T18:22:15Z")

</div>

Hey, worth a note I responded to your github issue on this 🙂[https://github.com/microsoft/pxt/issues/7531#issuecomment-711099287](https://github.com/microsoft/pxt/issues/7531#issuecomment-711099287). The issue was that the extension was stopping the path following, but not the sprites current velocity when the path follow rate was set to 0 - so it wasn’t following the path anymore, but just going innwhatever direction it was moving last. Easy fix though - after setting it to follow at rate 0 for the destroyed crewmate, you can call `set sprite velocity to 0vx 0vy` to clear it out yourself, or you can go in and update the version of the extension to one that fixes it (note that this will move your blocks around, though - I’d use a share link to make a backup just in case it gets rearranged in a eay you dont like)

---

<div class="post-metadata">

**Author:** ![Dahbixlp1](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Dahbixlp1](https://forum.makecode.com/u/Dahbixlp1)\
**Post date:** [October 18, 2020, 6:48pm UTC](https://forum.makecode.com/t/stop-path-following/3930/60 "2020-10-18T18:48:44Z")

</div>

Thank you very much! This will make everything easier! I already tried it and it works! I can finally take the game to the next step! And also thanks for the hitbox/distance between players extension! I was close to giving this project up, fortunately I did not! I will keep on coding! I started a few years ago in school with micro:bit. Then I realised what I can do with it! I coded a program with 5 Games and 3 apps you could choose from, but after that I had no ideas… So I searched for some ideas and found makecode Arcade! I am new to the arcade programming: Because I coded games on the micro.bit I knew about sprites and so on…  
At first I made a plane game… and later I was bored so I played Among Us and… yea… 💡  
I watched the makecode tower defense and found out there was a following extension…  
And btw sorry if my English is bad… I am from austria and young…  
Thanks!!! I can now start coding and maybe… there will be a game jam… soooo… Also I’ll probably get a meowbit for christmas…  
Thanks for your help!  
Regards  
Dahbix

Btw this is my second acoount because I only signed up yesterday and then my replys ran out and I have no idea on how to refill

[Previous page](https://forum.makecode.com/t/stop-path-following/3930.md?page=2)

[Next page](https://forum.makecode.com/t/stop-path-following/3930.md?page=4)
