Day 30: Immersion Starts with Sound

Tyler Smallwood
2 min readMay 21, 2021

--

Photo by Pawel Czerwinski on Unsplash

Objective: Add background music that plays while in game.

Yesterday was all about making the game look beautiful, but now we need to make it sound good as well. We want to have some type of music while playing.

We will need to add audio source to the objects that will have a audio clip to play music or sound effects. But for the sounds to be heard there will need to be a audio listener. By default on the Main Camera there will already be one. “The Audio Listener works in conjunction with Audio Sources, allowing you to create the aural experience for your games. When the Audio Listener is attached to a GameObject
in your scene, any Sources that are close enough to the Listener will be picked up and output to the computer’s speakers.” (Unity).

To do this we will create a Empty game object called Audio_Manager and create another empty under it called Background_Music.

On the Background_Music we will add a Audio source and put in the background music clip we have.

On that Audio Source we will have Play on Awake checked as well as Loop. This will have the music play as soon as the game starts and continue as long as you are in this scene.
This is how you have background music playing to make the game more enjoyable.

--

--

Tyler Smallwood
Tyler Smallwood

Written by Tyler Smallwood

I am passonate on learning to program and use Unity to become a skillful Unity Developer

No responses yet