# How to make a sprite move up and down while following another

**URL:** <https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844>\
**Category:** Arcade\
**Created:** [November 2, 2023, 4:16pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844 "2023-11-02T16:16:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilvince](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@Lilvince](https://forum.makecode.com/u/Lilvince)\
**Post date:** [November 2, 2023, 4:16pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844/1 "2023-11-02T16:16:18Z")

</div>

how can I make a sprite follow another sprite in only the Y value if there is a way?

---

<div class="post-metadata">

**Author:** ![ADM\_F](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/adm_f/32/19808_2.png) [@ADM\_F](https://forum.makecode.com/u/ADM_F)\
**Post date:** [November 6, 2023, 6:32pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844/2 "2023-11-06T18:32:44Z")

</div>

If sprite A Y value \> Sprite B  
Set Sprite A VY 40

something like that could work

---

<div class="post-metadata">

**Author:** ![ADM\_F](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/adm_f/32/19808_2.png) [@ADM\_F](https://forum.makecode.com/u/ADM_F)\
**Post date:** [November 6, 2023, 6:33pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844/3 "2023-11-06T18:33:43Z")

</div>

> **[Follow on Y](https://arcade.makecode.com/S34886-03642-47191-98543)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

here is a example

---

<div class="post-metadata">

**Author:** ![Computedduke586](https://avatars.discourse-cdn.com/v4/letter/c/6bbea6/32.png) [@Computedduke586](https://forum.makecode.com/u/Computedduke586)\
**Post date:** [November 6, 2023, 6:58pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844/4 "2023-11-06T18:58:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/7e1cfa2035ac88f46b01481153b3eb838ebfef44.png)  
This might work, don’t mind the errors, you just need to have the assets already made

---

<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:** [November 6, 2023, 7:58pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844/5 "2023-11-06T19:58:14Z")

</div>

> **[Test](https://arcade.makecode.com/S93984-78775-86217-54971)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

That would not work

---

<div class="post-metadata">

**Author:** ![Lilvince](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@Lilvince](https://forum.makecode.com/u/Lilvince)\
**Post date:** [November 9, 2023, 5:46pm UTC](https://forum.makecode.com/t/how-to-make-a-sprite-move-up-and-down-while-following-another/23844/6 "2023-11-09T17:46:02Z")

</div>

this worked, thanks so much!
