Adding Audio Immersion to the Game

In this article, we are going to add some background music to our game to provide more immersion for our players.

First, let’s create an Audio Manager for our game to take care of any overall audio. We’ll create an Empty object and name it Audio_Manager. Then inside of the Audio_Manager we’ll create another empty object named Background, which will be exclusively for playing our background music.

Next, we will select Add Component in the Inspector on our Background object and search for Audio Source.

In the Inspector we make sure both “Play On Awake” and “Loop” are selected. Then we go into the Project frame and open our Audio folder and drag music_background into the spot for AudioClip.

Now when we play the game the Background music plays automatically and it instantly gives another feel to the game.

I hope you found this informative and useful. And as always, I wish you the best of luck on your coding journey.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store