AudioStreamPlayer nodes disappear after changing scenes back and forth, how do I keep them?

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

So my project is based around doors that when interacted with change scenes to a different room. The problem is, when I start the game the audio nodes work just fine, but after changing a scene and then changing it back to the first one all the AudioStreamPlayer nodes that I placed in the editor disappear. Is there any way to bypass this bug? I don’t want to place the audio nodes by code because it would take massive amounts of time. Also here’s a video I made showcasing the bug, hopefully it’ll explain my problem better since my english isn’t perfect and this whole question is a mess probably:

youtube video here

And, I’m almost sure that this is an engine bug, because I’ve seen someone posting the same bug somewhere else.

:bust_in_silhouette: Reply From: Asheraryam

Instead of changing the scene, you can swap the game node and keep the audio node.

For example the scene tree would look like this:

– Audio Nodes
– Game Node

Then when you want to switch scenes, you remove the Game Node, and you instance the other level and add_child.

That will do the same thing as switching a scene but will let you keep the nodes you want. e.g. Audio, GUI, etc…