How to Add a Mute / Unmute Audio Button in Scratch
📌 What you will learn
Toggle volume between 0% and 100% when clicked.
Minimal Working Block Recipe
Toggle volume between 0% and 100% when clicked.
Test this minimal version first, then tune numbers like speed, gravity, or timing to match your game feel.
Add a Mute / Unmute Audio Button script
- when this sprite clicked -> if (volume) 0> then set volume to 0% else set volume to 100%
Try it: Essential for classrooms and quiet spaces.
Debugging Checklist & Next Steps
If it behaves unexpectedly, verify initial variable resets on the green flag and check that continuous checks sit inside a forever loop.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.