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

What I did at Mystery Hunt 2019

Connect Salesforce Oauth2.0 App with Python (without using any libraries)

Starting a New Project

How to convert WEBP to PNG in PHP

Break, Continue, and Pass Statements with Examples

What is version control?

Getting Started with Cloud Development Kit for Terraform (CDKTF)

LeetCode problem #4 — Median of two sorted arrays (JavaScript)

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

NoSQL and Version Controlling

CS371p Spring 2022 Week 2/7–2/13: Tejas Karuturi

Web3 Newsletter — Edition #5

CS373 Spring 2022: Hassan Khan — Week 7