Creating Immersion with Sound

Although sound is essential in building an immersive environment, it tend to be undervalued or even overlooked by starting game developers. Sound helps dictate what the player should feel. Play a slow piano melody and you can change the tone to somber. On the other hand, switch it to a fast beat tune and the tone suddenly switched to exhilarating.

However, before we start choosing which sound we want to play, we must first implement it in our scene.

Important Note

By default, Unity has put the Audio Listener on the Main Camera. Because you can only have one active Audio Listener at a given time, if you want another game object to have the listener, remember to disable or remove it from the Main Camera to ensure you won’t get an error like this:

Getting Started

First, decide which object you would like to use for the background. Depending on the type of game you’re making, the Main Camera would make sense. However, creating an empty game object and using that as an Audio Manager is good practice as you will not be relying on the camera and doesn’t require you to access the Camera in order to obtain the Audio source.

Once you’ve decided, go to the Inspector panel and select Add Component. Search for Audio Source and select it.

After you selected it, you now have a component that will accept your Audio clip!

Audio Source component

Other Notes

Depending on the music you’re playing, like background music, it might be advantageous to check both “Play On Awake” and “Loop”. On the other hand, for some audio clips, like sound effects, it might be better to not play the clip right away or in a loop.

If you do check both boxes, this will cause the audio clip to play automatically once you start the game, whether it be clicking on Play or in a finished build, and loop once the clip is complete.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

3 Signs that Your Ms Excel Files are Corrupt and What to Do

3 Signs that Your Ms Excel Files are Corrupt and What to Do

Conflux GPU Mining Testing

Cloud Console

Watch: Xmeters — Taskbar System Stats for Windows

3-month plan for Cracking the Coding Interview

Study Plan For Coding Interview

10 Most Amazing Use Cases of WebSockets — Go Real-time!!

HOW I HACKED NASA WITHOUT HTML !!

Primer guide to Android reverse engineering: apkdigger

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
Josh Vang

Josh Vang

More from Medium

Announcing that the full-scale TouchCon service has started!

Couldn’t Fetch Sitemap error On Google Search Console Solved

Structuring Your Club(s) on Clubhouse with the Clubhouse Mechanic… aka — Cyndilu Miller @beboldyou

InC for Art Blocks — An Interview