Vigyata.AI
Is this your channel?

Unity audio setup that actually works

37 views· 4 likes· 2:21· Dec 22, 2025

🛍️ Products Mentioned (5)

#unity #unity2d #gamedev Learn how to add background music in Unity and control it using a UI button. In this beginner-friendly tutorial, you’ll learn how to import a sound file, set up an Audio Source, create a simple C# script, and toggle the music on and off with a button. Chapters 00:00 Intro 00:05 Creating UI Button 00:25 Adding Audio Source 00:30 Importing Sound 00:38 Creating the Script 01:30 Attaching Script to GameObject 02:00 Testing Music 🎮 Play my Steam games: https://store.steampowered.com/curator/45606083/ 👍 Subscribe for More Unity Tutorials: https://www.youtube.com/@CasayonaCode 💬 Join Our Discord Community: https://discord.gg/hzg93VwPJe 👑 Support on Patreon (Free Assets!): https://www.patreon.com/c/CasayonaCode ❤️ Check Out My Itch.io Page: https://casayonastudio.itch.io/ 🖥️ Download Source Code & Assets: https://www.patreon.com/collection/961077?view=expanded 📩 Contact Me: casayona.team@gmail.com ❓ Have any questions or need help? Feel free to ask in the comments or join the community. ················································································ #unity3d #unity2d #gamedev

About This Video

In this video I show a Unity audio setup that actually works for beginners: importing a music clip, adding an Audio Source, and wiring everything to a simple UI button so you can toggle background music on and off. I keep it practical and focused—no overengineering—so you can drop it into a fresh project and immediately hear results. The goal is to get you from “I have an audio file” to “my game has controllable music” in just a couple of minutes. We start by creating a UI Button, then I add an Audio Source to a GameObject and import the sound file into the project. After that, I write a small C# script that holds a reference to the AudioSource and flips it between play/stop (or mute/unmute, depending on how you prefer it) when you click the button. Finally, I attach the script, hook up the references in the Inspector, and test it so you can confirm everything is connected correctly. If you’re building menus, pause screens, or just want a clean “music on/off” toggle, this setup is a solid baseline you can expand later.

Frequently Asked Questions

🎬 More from Casayona Code