- Home /
How do you add player music to your game?
I want the player to be able to add their own music in a file in the game and play it through a playlist, just like putting music on your phone. I'm using the free version of unity and I'm kinda new to Unity, Ive been searching around and i can't find anything, hopefully someone can help, thanks in advance.
Answer by armorhide406 · Aug 06, 2017 at 06:31 AM
Well you can drag and drop audio files into the project. I suspect one way of possibly doing it is adding a variable to recognize player added music, an audio source that can use that variable and somehow getting it to consider any added files on runtime/once built to that variable.
You're gonna wanna use arrays for playlists.
I'm not sure you can exactly do it though. I believe Unity is limited to music YOU add rather than any end user. Of course, you can look around further but this should get you started
http://answers.unity3d.com/questions/43387/how-to-create-arrays-in-c.html
https://unity3d.com/learn/tutorials/topics/audio/adding-music-your-game
https://forum.unity3d.com/threads/importing-audio-files-at-runtime.140088/
Your answer
![](https://koobas.hobune.stream/wayback/20220612132038im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Singletons in music script? 2 Answers
customizing loading page 2 Answers
Load custom music for a game on xbox one? 0 Answers
small problem with own music player script 2 Answers
Decompressing Custom Packages 0 Answers