Make Music Transfer Between Worlds

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zync

Ive been looking for tutorials all over the internet about how you can make music transfer between worlds but there is not a singe tutorial that shows how to do it.

Just wondering: are you trying to make the music crossfade, or have it persist between worlds? I would think that, to make it persistent, you could stick a musical node in the root node, and make the rest children of this node.

Ertain | 2019-06-09 23:41

You can play music persistently by adding a scene with an AudioStreamPlayer node as an autoload in the Project Settings.

Calinou | 2019-06-10 20:08

:bust_in_silhouette: Reply From: andersmmg

There are two ways you could do it.
1:
Use a “main” scene with your audio player in it and anything else you might want. Add a script and just add the current scene as a child scene as the world is loaded. When changing worlds, just remove that child and add the new world as a child.
2:
Use an autoload to persistently include the music in the base game. This often has less flexibility, but it does work pretty simply.