Hi, i´m novice, i want create background sound, i tried some tutorial, but it isn´t what i want and himself i can´t create this, i´m in a learning stage, i have 2 menu scenes and 1 game i´m created the sounds during scenes, but it´s during game scene and this is what i won´t, i want so that sound during just between menu scenes and when is game scene loaded the menu music will be stopped how i can create this ? thank for help sorry for bad english
You will need a StartupScene (just use your first Scene for that). In this Scene you create a GameObject which handels the Music.
The Script on this GameObject needs function like this:
function Awake () {
DontDestroyOnLoad (transform.gameObject);
}
function Update () {
if(inMenu == false){
audio.mute = true;
}
else{
audio.mute = false;
}
}
As you see you need a Variable which tells the Script if you are in Menu or in Game.