Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: wheretheidivides on May 23, 2014, 03:52:25 PM
-
So I have a music manger on the main menu. It plays music. I goto scene 2 to choose a vehicle and to scene 3 to choose a arena. The music stays as I use don't destroy on load. Now, if I exit and go back to scene 1 which is the main menu, there is a problem. It reloads the scene and a 2nd music manger appears in the hiercy playing the music a 2nd time. So my question is, how can I get it to NOT load the music manger game object when going from scene 2 to scene 1? This way the original music that loaded at game start will just keep playing.
-
I figured this one out. I set up a bool with music playing or not. then on scene 2, if I go back to scene 1, I set the global variable to true. That way scene 1 checks and sees the music is playing so it does noting.
-
I also downloaded the destroy tag. I tagged the music game manager as music. Then when the game starts (after the menus), I destroy everything with that tag. The reason is that going to the main menu would create a new game manager. That way, whenever going to the main menu from the game, there will be only 1 game manager.
-
Alternatively, you could start the music manager in an Init scene- before loading the main menu scene. I do this on android to make the first loading screen a bit shorter with a nearly empty scene, and passing the loading on to future scenes. ;)
Init scene is one you'd never come back to. Main menu however you might go to a lot.
-
Yeah I did think about that too. A scene 0 which loads the music and then scene 1 is the main menu. That way the music would never get loaded twice. Another good idea.