Unity Development — Background Music

We’ve made some gameplay. We’ve add art and animation to polish it up. I believe it is time now to get the blood pumping with some music.

This is going to be a fairly quick lesson. There are complications that can come in from adding audio to your Unity project, but adding background music is the first step and is extremely simple. Of course, you will need to import a musical track of your choosing. It would also be wise to have an ‘Audio’ folder in your Project Window.

In the Hierarchy, make an empty object that will be your Audio Manager. You will most likely use this Audio Manager for jobs other than playing the background music, so let’s also make a child of it, and call it Background or Background Music.

Go to the Inspector of that object and add an Audio Source component. There are a lot of attributes in this component. You can place any track you his in the ‘AudioClip.’ Loop will tell the track to loop repeatedly. Play on Awake will play your track as soon as the scene begins. Other we will touch upon another time.

Drag your track into the ‘AudioClip’ section. Turn or Loop and Play on Awake. Start your Scene and listen to the music play. This will loop repeatedly, so now you have background music for no matter how long the player keeps going.




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

Recommended from Medium

The beginnings of DevSecOps for NodeRED

How To Get Free Acess To Pluralsight, Datacamp, LinkedIn Learning Using Visual Studio Dev…

.NET Core Dependency Injection

My 100DaysOfCode Journal Day — 05

Phaser Trailblazers

How to Collect Data from TikTok (Tutorial)

the start.

The ‘Literal’ Annotation in Python

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
Christopher Graf

Christopher Graf

More from Medium

Making “Eyes” in Unity(Game Dev Day 61)

3rd Person Controller Using Cinemachine Virtual Camera On Mobile

The Ultimate Guide To Start Making 3D Video Games

Tesseract — Teleportation in Virtual Reality

texture material with the correct dimensions