# How to disable a button!

**URL:** <https://forum.makecode.com/t/how-to-disable-a-button/31104>\
**Category:** Help\
**Tags:** game\
**Created:** [October 10, 2024, 5:48pm UTC](https://forum.makecode.com/t/how-to-disable-a-button/31104 "2024-10-10T17:48:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gravethecoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gravethecoder/32/17144_2.png) [@gravethecoder](https://forum.makecode.com/u/gravethecoder)\
**Post date:** [October 10, 2024, 5:48pm UTC](https://forum.makecode.com/t/how-to-disable-a-button/31104/1 "2024-10-10T17:48:49Z")

</div>

Hello! I’m gonna show my way of disabling a button in makecode (if you don’t want you character going up and down)

 ![Screenshot 2024-10-09 111636](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/8/68f3e008ede4a25719253fe738c183753f8a7769.png)  
(just follow picture if you dont wanna follow text form 🥲)

First is to get the [On button pressed/released] block in controller, Then get [If true/false] block in logic (set it to true). Then get the [Move sprite with buttons vx 100 vy 100] click on the plus to access the VY and VX thingy. Set both of those to zero (duplicate). Then get the same button block but set it to release, Get the VX/VY block and set it back to 100.

Example below!!  
BEWARE that there is a small bug where if you do press up and down at the same time you will end up moving up or down!!

![ScreenRecording2024-10-09112145-ezgif.com-video-to-gif-converter](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/c/5c8d932d998c6bf535f9535a354793a0b616c91f.gif)  
Hope this helps :princess:

---

<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:** [October 10, 2024, 5:59pm UTC](https://forum.makecode.com/t/how-to-disable-a-button/31104/2 "2024-10-10T17:59:14Z")

</div>

Or you could Set VY to zero in this context it shares the same purpose and is More efficient

> **[walking side to side but easy](https://arcade.makecode.com/S17571-98719-18880-14475)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Also the Booleans ( the Blue True blocks) don’t do much without other stuff defining them its nice for debugging or getting through menus but from a players point of view it does nothing
