So now that we know how to create background music let’s see how to add a sound effect that’s triggered by a player action such as firing the lasers. First we need to decide what we want to make the sound. Now I plan to use these lasers for the enemy as well so it would make sense to attach the sound on the laser prefab.
Unlike the background music we don’t want this to loop but we would like it to play over our background music so we can raise the priority for that.
As you can see it is quite simple to add a SFX to an object and have it trigger on awake.