Music and sound FX play a huge role in capturing an audience, weather in an advertisement, movie or a video game. The music can really set the mood for a scene, be it a funeral or a dance party. I personally love music, from the stage or crowd alike, so I am excited to get to this point in my game’s development.
In order to get going with game audio, I head to my hierarchy and make a new empty game object and call it Audio Manager.
The Audio Manager will handle playing sound FX as well as some different musical themes. For the purpose of keeping things organized, I make another game object as the child of the Audio Manager, and name it Game Background Music. This child object will of course, only handle the playback of the background music.
The child object for the game background music needs a component of type Audio Source.
Play on Awake gets checked, being I want the music to play immediately when the game starts. I also want the background audio to Loop, so I check that box as well.
My game background music is assigned to the AudioClip dialogue box in the Audio Source component via drag and drop.
I now have some peaceful music for cruising the vast blue ocean and avoiding treacherous piranhas. In my next article, I will tackle playing back sound FX for certain situations. Thanks for reading!