Background Music Persist Across Scenes

I’m making a 2d-platformer with fairly short levels. I’d like the background music to persist across different levels, so it’s not changing or resetting every 30 seconds as the player finishes. How can I go about this?

By reading the [docs][1]. [1]: http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html

do not destroy the music object

1 Answer

1

I created a separate object for the music and added DontDestroyOnLoad(this.gameObject); and it solved the problem.