i’m having a problem with background music . I have 4 scene ( Test 1, Test 2, Trainning 1, Trainning 2 ) . I created GameObject called : “Test Music” with Tag “Background Music”, GameMusic Script, Audio : Test.ogg in Test 1 + 2 scene and “Trainning Music” with the same tag, same Script, Audio : Trainning.ogg in Trainning 1 + 2. So what i want to do is : When changing the scene from Test 1 to Test 2, Trainning 1 to Trainning 2, Test 2 to Trainning 1 and Trainning 1 to Test 2, The script will find object with tag “Background Music” and check : If GameObject in previous scene( Using DontDestroyOnLoad ) have the same name as GameObject in current scene, the script will destroy GameObject in current scene. If they have different name , the script will destroy the GameObject in previous scene. I know i can find a lot of way about how to do it, but it’s not what i want to do. For Example : https://answers.unity.com/questions/1253516/playing-audio-through-multiple-scenes.htmlThis answers almost like my purpose but it add scene in order to make the audio to be destroyed when change to some specific scene. But if i have 60 70 scene with different music, do i need to add all of the scene ? or if i set specific scene to play specific music (Like playing Test.ogg when load Test 1 + 2 scene) , can music continue to play when go to Test 2 from Test 1 ?
I’m having a hard time interpreting your question, but it sounds like you want some specific behavior for background music between scenes.
Why not have a persistent object that controls background music which uses SceneManger.sceneLoaded or something to check the background music when there’s a change?