Unity…the Musical!

Ryan Sweigart
Apr 25, 2021
Who am I? I am Wolllll…verine!

No video game is truly complete without music! The right piece of music can affect the tone of your game. Luckily, Unity makes it super easy to play background music.

The main camera in every scene has an Audio Listener component by default. You can only have one Audio Listener active in a scene at any given time. To give the listener something to…listen to, we’ll create an empty game object with an Audio Source component.

We set the AudioClip to the piece of music we want to play, check Play On Awake so the music starts playing at the start of the scene, and check Loop so the music will continually play.

That’s it! Play your game and bask in the symphonic excellence!

--

--