# Continuous Music through Level Change and Restart

**URL:** <https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362>\
**Category:** Audio\
**Tags:** unreal-engine, music, question\
**Created:** [October 23, 2020, 10:31am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362 "2020-10-23T10:31:03Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [October 23, 2020, 10:31am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/1 "2020-10-23T10:31:03Z")

</div>

Hi all

I have been looking online and have been trying to implement this and I’m getting absolutely no luck.

I’m trying to get a sound file (music track) to play and continue to play through level changes and when the level restarts i.e. when the level restarts, the music should not restart but should continue playing. I have been trying with various things, including persistence levels, but I’m not getting anywhere.

Does anyone have a working solution for this?

Attached is my Restart Level code, in case that may be causing issues with persistence levels.

Thank you in advance for any assistance.

Cheers  
Matt

 ![319792-restartlevel.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/d/bed50c60770afc02fe07c49d4916603f957679e9.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 23, 2020, 11:10am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/2 "2020-10-23T11:10:44Z")

</div>

You certainly can do this with level streaming, play the music in the persistent.

I thought there was a simpler way, but…

EDIT: Ok, yeah, you have to play it from the game instance. It also has to be assigned to a variable:

 ![319795-screenshot-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/e/d8e871bb8f689cc0e40fb50b1086f015d7b6b535.jpeg)

In the level BP ( of the first level ):

 ![319796-screenshot-4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/4/9/5490960afab90d8e2abd85d84b10c1799f7750f6.jpeg)

You also need to specify to use your game instance in the ‘maps and modes’ section of the project settings.

AND, you need ( in the game instance ):

 ![319797-screenshot-5.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/2/882306244ee952cdb8c7c6b6fd53c8031d0139fd.jpeg)

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [October 23, 2020, 11:35am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/3 "2020-10-23T11:35:38Z")

</div>

Thanks! This code is getting somewhere.

I’m noticing that if the level restarts, it seems to trigger the music again, so that multiple instances of the track are playing at once. Are you getting this as well with your code?

EDIT: It only happens on Level 1, which makes sense as that is the Level that has the Blueprint that triggers the PlaySound function. Should some sort of branch be used here to stop the music from being triggered again if the level restarts?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 23, 2020, 11:43am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/4 "2020-10-23T11:43:43Z")

</div>

It could do. Just change the start code to this:

 ![319789-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/e/e0e5138873625788234e3a8639366ae464118ecb.jpeg)

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [October 23, 2020, 12:01pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/5 "2020-10-23T12:01:41Z")

</div>

This is fantastic. Thank you very much - you have saved me lots of time and this is a such a great clean solution. I have marked this question as answered.

There is one final element I wish to set up, and that is to put into a future Level the capability to change the music that is playing. I have taken a quick stab at it in the GameInstance (code below) and it is not working for obvious reasons. However, I’m a little unsure as to what is the cleanest way to achieve this.

Would you happen to know a solution to this one?

My thoughts are that a good flow would be for the Level Blueprint to trigger ‘Music2’, which is in the Game Instance. However, I have to make ‘Music2’ reset the sound in ‘PlayMusic’.

Cheers  
Matt

 ![319800-triggermusic2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/9/6/996614618b6143ca6fc8f49db86673109e47c505.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 23, 2020, 12:04pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/6 "2020-10-23T12:04:25Z")

</div>

A slight variation on the ‘play music’ custom event.

Instead of just checking if the reference is valid, it can check if the specified piece is already playing. If not, then stop anything that is playing and play the new piece instead.

Will put up a graph in a mo…

boom:

 ![319811-screenshot-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/5/1a59c051f3ed784ef44536d4e66289469393739b.jpeg)

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [October 23, 2020, 10:23pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/7 "2020-10-23T22:23:08Z")

</div>

This is extremely useful and so easy to work with. Thank you again!

Another question has come to my mind - what is a clean way to ensure that the desired music plays when the player loads the game and starts from a Level that is not the first Level that triggers the desired music?

One solution would be to put this code in every Level Blueprint, and modify ‘Sound to Play’ to suit (screenshot below).

 ![319868-setsound.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/3/253c85ef528a5ee33fad4669085d846e7415602b.png)

With this solution, multiple Levels would have to have the exact same code. For instance, Levels 1- 10 require the same music, so the exact same code should be placed into the Level Blueprints for Levels 1-10.

The only issue I can foresee with this is that if I have to rearrange levels, then I will need to double check each Level Blueprint to ensure the appropriate sound is triggered. I’m wondering if there’s a cleaner way to achieve this.

What are your thoughts?

Cheers  
Matt

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 23, 2020, 10:37pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/8 "2020-10-23T22:37:58Z")

</div>

Why not start it from the game instance? That way it will always play regardless of level…

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [October 24, 2020, 12:50am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/9 "2020-10-24T00:50:19Z")

</div>

Interesting. I have 2 questions regarding this approach:

1. How do I trigger an event from Game Instance? Event BeginPlay does not seem to be available in a Game Instance.

2. How can I control which sound file plays for which level if the PlaySound function is in the Game Instance? For instance, how can I ensure that Levels 1-10 play SoundFile1, and Levels 11-20 play SoundFile2?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 24, 2020, 10:24am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/10 "2020-10-24T10:24:52Z")

</div>

1. In the GI, it’s called Event Init.

2. If you want different music for each level, then do what you’re doing now - ie - make a call to the GI from the level BP. That’s the best place for it 🙂

---

<div class="post-metadata">

**Author:** ![cruisy18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cruisy18](https://forums.unrealengine.com/u/cruisy18)\
**Post date:** [October 24, 2020, 10:50am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/11 "2020-10-24T10:50:50Z")

</div>

Awesome, thanks again mate!

---

<div class="post-metadata">

**Author:** ![Sunsetlettuce93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sunsetlettuce93](https://forums.unrealengine.com/u/Sunsetlettuce93)\
**Post date:** [May 17, 2023, 11:28am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/13 "2023-05-17T11:28:54Z")

</div>

how would i stop the sound on a level if i didn’t want music

---

<div class="post-metadata">

**Author:** ![DarkRod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DarkRod](https://forums.unrealengine.com/u/DarkRod)\
**Post date:** [May 27, 2023, 9:32am UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/14 "2023-05-27T09:32:16Z")

</div>

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![dishcleanser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dishcleanser](https://forums.unrealengine.com/u/dishcleanser)\
**Post date:** [June 12, 2023, 1:17pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/15 "2023-06-12T13:17:50Z")

</div>

Hello, I have run into an issue, I am basically attempting the same thing, and have been following along, but for some reason whenever I tick the persist between level transitions box the sound mutes itself. When I check it says that the sound is playing and that the volume multiplier is set to 1, but there is no sound playing, how do I fix this?

---

<div class="post-metadata">

**Author:** ![dishcleanser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dishcleanser](https://forums.unrealengine.com/u/dishcleanser)\
**Post date:** [June 12, 2023, 2:16pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/16 "2023-06-12T14:16:12Z")

</div>

Update: I tried this out of desperation and for some godforsaken reason this works:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/f/f2fd70122dcaace6b1d549083801fdee0046f59a.png)

---

<div class="post-metadata">

**Author:** ![Amyseqmedia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amyseqmedia](https://forums.unrealengine.com/u/Amyseqmedia)\
**Post date:** [February 10, 2024, 9:01pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/17 "2024-02-10T21:01:44Z")

</div>

This is the best answer; I had to unpack it a little to understand it for Unreal 5.3:

1. Import your soundtracks as a audio wave files and stash in your content (I use an Audio folder).

2. Create a Sound Cues. In each one set the Class to Music, and drop in the soundtrack WAV, making to to make it loop

3. Create a blueprint of type Game Instance, e.g. BP\_GameInstance

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/5/f950037c63ea78b72cf23628e146aa45400d55d6.png)

1. Change the game instance class: Project Settings \> Maps & Modes \> search for “game instance” \> change to your BP\_GameInstance

2. Edit the BP\_GameInstance blueprint

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/a/27a7ebf5f2fbd895a6062d751177a0d9b5671067.png)

5b) Create variables to hold the currently playing sound component, and the last sound cue. Bonus: add a variable for the audioFadeTime.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/3/ab3aa62ba2b18065528d42c46e01ef35ceb9392d.png)

5c) I went with a Custom Event called “PlaySoundtrack”. It takes a “new sound cue”. If the current playing sound is the same as what was last playing, it does nothing. Otherwise it fades out the current soundtrack and then spawns a new soundtrack.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/b/a/8ba97c557e19fc857e68f7654ac2f7143141bca8.png)

1. I made a global function (Blueprint Function Library) that takes a Sound Cue and calls the BP\_GameInstance custom event to play the cue

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/5/0e5881b62a51cf67a020f16e3700448b0ee5d656.png)

1. Finally, on each level/map, it’s as easy as going to the event graph and on Event BeginPlay you can call the global PlaySoundtrack function. That way whatever level you play it will play the right soundtrack, but it won’t change it if it’s the same song.

---

<div class="post-metadata">

**Author:** ![jashPD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jashPD](https://forums.unrealengine.com/u/jashPD)\
**Post date:** [July 22, 2025, 6:13pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/18 "2025-07-22T18:13:09Z")

</div>

This is so far the best solution based on @ClockworkOcean answer. Thanks.

---

<div class="post-metadata">

**Author:** ![HeyitsSavio](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/heyitssavio/32/1185092_2.png) [@HeyitsSavio](https://forums.unrealengine.com/u/HeyitsSavio)\
**Post date:** [May 19, 2026, 6:09pm UTC](https://forums.unrealengine.com/t/continuous-music-through-level-change-and-restart/473362/19 "2026-05-19T18:09:25Z")

</div>

I recently published my Persistent Music Plugin which will handle all of this automatically for you through a handy subsytem

> **[Persistent Music](https://www.fab.com/listings/f59486af-4456-450a-b37f-9856ed0a808f)**
>
> Have you ever wondered why music and sounds stop when unloading and opening a new Level?The Persistent Music Subsystem handles everything you need to have music persist from the moment your game Launches to the second you Quit Game!This is the only...
