CRI ADX(Unreal Engine) v1
Intermediate Level 19: Changing the Persistent Level While Keeping the Sound Playing
Normally, audio stops when switching persistent levels.
However, there may be times when you want to switch persistent levels while the sound is still playing.
This time, I will explain how to do this.
Before starting
To avoid confusion, please remove the sounds placed in the level and the nodes placed in the level Blueprint in the previous tutorial.
Create a GameInstance Blueprint Class
Create a new Blueprint Class.
In this case, select "GameInstance" as the parent class.

Let's name it "AtomGameInstance" this time.
Open the AtomGameInstance Blueprint class.

Add one variable.
For Type, select "Object Reference" of AtomComponent.
Let's name it "MyAtomComponent" this time.


Compile the Blueprint.
Using the GameInstance Blueprint Class
Open the "Maps & Modes" page in your project settings and find the "Game Instance Class" item.
Change its setting to "AtomGameInstance".
Play audio
- Open the level's Blueprint.
- Run the "Spawn Sound 2D" node.
- Please specify a 2D sound for the "Sound" pin.
- The recommended one is "Heli_Loop_Normal". (Already distributed in Beginner's Edition 07)
- Check the "Persist Across Level Transition" pin.
- Also, set the “Return Value” to MyAtomComponent of AtomGameInstance.

That's all the settings.
Playing audio in this way ensures that the audio will not cut off when the persistent level switches.
What if I want to stop the audio?
If you want to stop the audio after switching the persistent level, do as shown below.
