Music multiple scenes - Bug or really simple error?

Hey everyone,

I have built a game that Has a Main Menu and a Music credit page (accessable fromt Main Menu through GUI button.

I have music on a empty GameObject and in my GUI button script looks like this;

    if (GUI.Button (Rect ( Screen.width * 0.75, Screen.height * 0.4, 120, 50), "Music", "button")) 
{

    DontDestroyOnLoad(GameObject.Find("musicplayer"));
    Application.LoadLevel ("musicpage");
}

So the new page loads fine, the GameObject is there, BUT no music is playing?.... why?

When your "musicplayer" still exists in your "Music page" i guess you don't have an AudioListener in your scene. The Listener is normally attached to your camera.

You may also take a look at the scripting reference.

Just to bring closure to this post.. i created a blank scene at the start of my project with AudioSource, AudioListener & DontDestroyOnLoad.

Then in the "Intro/Menu" scene i had a script which check ifaudio is playing, dont destroy, if not, play new instance... then the DestroyObject was in my first level of the game.... worked a treat.