# How to make platforms all work

**URL:** https://forum.makecode.com/t/how-to-make-platforms-all-work/13972
**Category:** Help
**Created:** [June 6, 2022, 5:03pm UTC](https://forum.makecode.com/t/how-to-make-platforms-all-work/13972 "2022-06-06T17:03:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Starfox2k](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@Starfox2k](https://forum.makecode.com/u/Starfox2k)
#### Post date: [June 6, 2022, 5:03pm UTC](https://forum.makecode.com/t/how-to-make-platforms-all-work/13972/1 "2022-06-06T17:03:41Z")

</div>

So I’m making a game with moving platforms. I figured out how to  
make a sprite sit on another. But it only works on the first moving platform  
and not the rest. Help would be greatly appreciated. Thanks.

> **[3 Level Platformer](https://arcade.makecode.com/49386-12641-55641-01467)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)
#### Post date: [March 15, 2023, 12:49am UTC](https://forum.makecode.com/t/how-to-make-platforms-all-work/13972/2 "2023-03-15T00:49:21Z")

</div>

It’s because of this code

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/334069e660bf1c6b9e2a7d9ddaff4e88fce81960.png)

you set it so mysprite x and v velocity are the platforms, which is good but you set it to the latest created platform, which is why it only works for the first platform you encounter. To fix this you probably have to create a function. In this function add a sprite variable. Put the code in the screenshot into the function now if you added a sprite to the function drag at the red oval that says sprite or if you changed it to whatever you changed it too. then put the dragged out oval into the MovingPlat’s vx and vy place.

---

<div class="post-metadata">

### Author: ![RiverVolcano923](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rivervolcano923/32/14168_2.png) [@RiverVolcano923](https://forum.makecode.com/u/RiverVolcano923)
#### Post date: [March 18, 2024, 4:13pm UTC](https://forum.makecode.com/t/how-to-make-platforms-all-work/13972/3 "2024-03-18T16:13:30Z")

</div>

Can you show a picture because I don’t know what you mean by what you said.
