[HELP]Music doesn't work

I have the music on a scene and I want that it continues when I load other scenes ,but it doesn’t work and I can’t understand why

CODE: https://gist.github.com/anonymous/bc7039ffa79aa766458156d141f1b232

Does the musicPlayer play in the initial scene when you test?

Is this script attached to the gameobject that is required to persist?

is the audiosource set to loop?

Does the musicPlayer object persist to next scene in the heirarchy when loaded?

void Start () {
DontDestroyOnLoad(gameObject);
}

should work, for the gameobject that this script is attached to, just ran a test and it works ok.

Privacy & Terms