# Help with my game about the up button

**URL:** <https://forum.makecode.com/t/help-with-my-game-about-the-up-button/11873>\
**Category:** Help\
**Created:** [January 24, 2022, 8:23pm UTC](https://forum.makecode.com/t/help-with-my-game-about-the-up-button/11873 "2022-01-24T20:23:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunters4658](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/hunters4658/32/5766_2.png) [@hunters4658](https://forum.makecode.com/u/hunters4658)\
**Post date:** [January 24, 2022, 8:23pm UTC](https://forum.makecode.com/t/help-with-my-game-about-the-up-button/11873/1 "2022-01-24T20:23:22Z")

</div>

How do I disable the up button so my character stays on the ground except when he is jumping

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [January 24, 2022, 8:24pm UTC](https://forum.makecode.com/t/help-with-my-game-about-the-up-button/11873/2 "2022-01-24T20:24:19Z")

</div>

Could you share a link to your code? Here’s a GIF showing how to do that:

![2022-01-11 10.49.58](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/0ac06b4feb9e3db866e8b677436c59a9b1f515e3.gif)

---

<div class="post-metadata">

**Author:** ![hunters4658](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/hunters4658/32/5766_2.png) [@hunters4658](https://forum.makecode.com/u/hunters4658)\
**Post date:** [January 27, 2022, 5:44pm UTC](https://forum.makecode.com/t/help-with-my-game-about-the-up-button/11873/3 "2022-01-27T17:44:36Z")

</div>

Here is a link to the code [https://makecode.com/\_EEhJ1aTjvFWj](https://makecode.com/_EEhJ1aTjvFWj)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [January 27, 2022, 6:02pm UTC](https://forum.makecode.com/t/help-with-my-game-about-the-up-button/11873/4 "2022-01-27T18:02:25Z")

</div>

Thanks! You can detect if your character is on the ground or not using the “is hitting wall in direction” block. Based on your code, it looks like you want the character to fly if they press left/right in the air and stop flying once they hit the ground. To make that happen, I altered your code a bit:

 ![Screen Shot 2022-01-27 at 9.59.36 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/96900ab3719bbc5b2f9d7d0990ca2a0061ffcc35.png)

I made it so that all of the code that start the flying is within a “is not hitting wall bottom” if statement.

Then, I added an “on game update” to check every frame if the player is back on the ground, and set the vy in the “move with buttons” to 0 if they are.
