Click, Bang & Boom! — A guide to playing sound effects in Unity

Luke Duckett
2 min readApr 22, 2021

--

Continuing on the previous article we are going to play and trigger a sound effect.

Adding a sound effect to an object makes the game feel much more immersive. So for our next step, we are going to add a sound effect to our explosions.

We start by creating a script for our audio manager in which we take an audio clip as a parameter. The audio manager is a singleton so we can easily access it and call our function from other scripts.

Next, we need to add our explosion audio clip as a reference in our explosion script and call it when our game object becomes active.

Next, we need to add our sound effects as a group and make them louder than our background music in the audio mixer.

Now we can add our sound effect audio source by adding an empty game object as a child to our audio manager and add an audio source component to it.

Remember to assign the audio mixer group in the audio source, assign the explosion clip in the explosion prefab and assign the sound effects audio source game object to the audio manager.

And there we go a simple yet effective way to play sound effects.

--

--

Luke Duckett
Luke Duckett

Written by Luke Duckett

🎮 First Nations Unity Dev from Wonnarua country 🏞️ | From Player to Lifelong Learner: Crafting Games, Debugging Code, and Embracing New Technology

No responses yet