Playing music

I have a simple question. How can I get unity to play an audio clip in a loop when you playing the game. I just need a simple code to play the music, which I assume has to be in the assests folder.

No need for code if you intend to keep it that simple. Add an audio source component to main camera and set its source and check the Loop. And yes everything you create for your game must be in assets folder.

Yeah, I put an MP3 in my asset folder, once it auto-imports I drag it to my character camera so it’s always at the right location, then I click the loop checkbox to keep it playing. No scripting required.

BTW, some good free music sources:

http://soundcloud.com/guiltypixel/mysteries-rpg-background-music

http://free-loops.com/228-fantasy-loop.html

I am always on the hunt for more RPG / Fantasy Royalty free/free music.

Thanks. This is the first time I’ve added music to a game. After a few simple soundless games it starts to get boring. And thanks for the music sources. I’ll be sure to look at them :slight_smile: