2D Shooter: Adding Background Music


Objective: Add music to play in the background.

Adding audio in Unity is rather simple. For the purpose of our game, we’ll need to create two empty objects, and one should be the child of the other. The parent will be “AudioManager”, and the child object will be “Background_Audio”.

Now in the background audio object, add a Audio Source component. Now all you need to do is drag the audio file into the box next to “Audio Clip” and make sure the boxes next to “Play on Awake”, and “Loop” are checked.

Now there is music when you play the game!



Sabrina Windsor

Currently learning to code with the help of GamedevHQ in order to someday my my game ideas come to life!