Keeping Interactive Music Between Multiple Scenes (Unity)


(Jacques Deaver) #1

I’m having some issues with the Studio Event Emitter linked to a Player object in Unity. I have music playing that changes based on whether the Player object is inside or outside, but inside/outside scenes are different scenes.

But when the player hits a Trigger to change scenes and it changes to the inside scene, the music starts playing again, but with the inside music playing at the same time as the outside music (which then stops after 2 bars as I programmed).

What I’m trying to do is keep the music emitter playing when transitioning between inside/outside so that it can pick up the parameter change for inside music and carry on the loop. Would anyone be able to help me figure this out?


(Cameron Baron) #2

Is your player object being destroyed and recreated for each scene? Using DontDestroyOnLoad would allow you to keep an object alive across multiple scenes.
https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html