# Play music through scene changes

**URL:** <https://qa.fmod.com/t/play-music-through-scene-changes/11432>\
**Category:** Unity\
**Created:** [April 29, 2014, 12:09am UTC](https://qa.fmod.com/t/play-music-through-scene-changes/11432 "2014-04-29T00:09:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![puma](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@puma](https://qa.fmod.com/u/puma)\
**Post date:** [April 29, 2014, 12:09am UTC](https://qa.fmod.com/t/play-music-through-scene-changes/11432/1 "2014-04-29T00:09:48Z")

</div>

Hello!

I’m new to fmod and I’m impressed by the power it provides for game developing. Nevertheless, I’m trying to do something that I think is typical and hope that someone could give me a clue. I’m trying to play a theme with fmod that “survives” when a new scene is loaded in Unity.

In the first scene I have a GameObject with the FMOD\_Listener and another script that creates the event instance, starts the music and sets “DontDestroyOnLoad”.

```auto
	private FMOD.Studio.EventInstance _musicEvent;
	private FMOD.Studio.ParameterInstance _exitParameter;

	void Start () 
	{
		DontDestroyOnLoad(gameObject);
		_musicEvent = FMOD_StudioSystem.instance.getEvent("event:/Music/Menu");
		_musicEvent.start();
		_musicEvent.getParameter("Exit", out _exitParameter);

	}
```

The music starts to play. Then, after five seconds I load a new scene and the music stops.

My GameObject survives but the music disappears.

Could anyone help me?

Thanks!

---

<div class="post-metadata">

**Author:** ![puma](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@puma](https://qa.fmod.com/u/puma)\
**Post date:** [April 29, 2014, 12:29am UTC](https://qa.fmod.com/t/play-music-through-scene-changes/11432/2 "2014-04-29T00:29:59Z")

</div>

Well, looking at the code I found a workaround. I added the following line to my script:

```auto
DontDestroyOnLoad(GameObject.Find("FMOD_StudioSystem"));
```

Now it’s working. Is this solution correct?

Thanks!

---

<div class="post-metadata">

**Author:** ![Guest1](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Guest1](https://qa.fmod.com/u/Guest1)\
**Post date:** [April 29, 2014, 5:39am UTC](https://qa.fmod.com/t/play-music-through-scene-changes/11432/3 "2014-04-29T05:39:27Z")

</div>

Yes that is correct, if you want to have audio to continue across scene changes you need to use DontDestroyOnLoad.
