# How do you make your characters have gravity?

**URL:** <https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662>\
**Category:** Help\
**Created:** [June 23, 2026, 7:31pm UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662 "2026-06-23T19:31:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrGhost15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mrghost15/32/33300_2.png) [@MrGhost15](https://forum.makecode.com/u/MrGhost15)\
**Post date:** [June 23, 2026, 7:31pm UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/1 "2026-06-23T19:31:21Z")

</div>

I need help with getting gravity for my characters because I’m trying to make a simple RPG but I can’t figure out how to make gravity for my player and enemies.

---

<div class="post-metadata">

**Author:** ![BitBot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bitbot/32/33272_2.png) [@BitBot](https://forum.makecode.com/u/BitBot)\
**Post date:** [June 24, 2026, 12:03am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/2 "2026-06-24T00:03:16Z")

</div>

Is this what you want?

> **[Gravity - DEMO](https://arcade.makecode.com/S27597-38737-01626-54749)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)\
**Post date:** [June 24, 2026, 12:03am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/3 "2026-06-24T00:03:36Z")

</div>

Ah, [gravity](https://arcade.makecode.com/S32608-83594-57527-46901). The one variable that is not named something obvious. You see, when makecode was created, gravity was named “ay” for “acceleration y”. This was because it does not make since for gravity to be -400 and make you rise, and also, “gravity X” would get even weirder. Therefore, they decided to name them “vx” and “vy”.

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [June 24, 2026, 12:03am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/4 "2026-06-24T00:03:38Z")

</div>

In the case of platformers, we would traditionally apply an AY property to everything we want to have gravity.

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [June 24, 2026, 12:04am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/5 "2026-06-24T00:04:21Z")

</div>

The simplest way is just to set the sprite’s ‘ay’ value to something like 50-200! (The higher the number, the stronger the gravity.)  
This way, they ‘accelerate’ towards the bottom of the screen!  
Keep in mind that if you were using the ‘move sprite with buttons with velocity 50’ block and want your player to be able to jump, you should use the expansion plus icon to only make the player move horizontally, not vertically. That way you can use the up arrow to set the player’s vy to something like -100, creating a more realistic jump!  
Here’s what I mean:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/b/db4e213be4855e8300d916200853392b4e56344b.png)

---

<div class="post-metadata">

**Author:** ![DimonSw0rd11](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dimonsw0rd11/32/32564_2.png) [@DimonSw0rd11](https://forum.makecode.com/u/DimonSw0rd11)\
**Post date:** [June 24, 2026, 12:04am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/6 "2026-06-24T00:04:47Z")

</div>

Use a “set sprite ay” block

---

<div class="post-metadata">

**Author:** ![Astro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astro/32/35479_2.png) [@Astro](https://forum.makecode.com/u/Astro)\
**Post date:** [June 24, 2026, 12:05am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/7 "2026-06-24T00:05:12Z")

</div>

Set sprite AY to

---

<div class="post-metadata">

**Author:** ![MrGhost15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mrghost15/32/33300_2.png) [@MrGhost15](https://forum.makecode.com/u/MrGhost15)\
**Post date:** [June 24, 2026, 3:34am UTC](https://forum.makecode.com/t/how-do-you-make-your-characters-have-gravity/44662/8 "2026-06-24T03:34:48Z")

</div>

Thanks! This has been really helpful for my game.
