I do this in the singleton
**func start_music():**
# if a music is playing, remove it
if music_player != null:
music_player.stop()
# play the new song
music_player = play_sound_effect(current_music)
**func scene_changer(next_scene, avoid_load=false):**
times.append(["scene_changer", OS.get_time(), next_scene])
# this function controls how scenes are changed
if resumable_scenes.find(next_scene) > resumable_scenes.find(resume_scene):
resume_scene = next_scene
# save the changes to the game play
save_game()
if get_tree().get_current_scene().get_name() in ["Loading", "Earthquakes2", "House2"]:
avoid_load = true
if scenes_path[next_scene]["has_loading"] and not avoid_load:
scene_to_load = next_scene
if not get_tree().change_scene(scenes_path["Loading"]["path"]) == 0:
logger.error("It was not possible to change the scene")
else:
scene_to_load = ""
if not get_tree().change_scene(scenes_path[next_scene]["path"]) == 0:
logger.error("It was not possible to change the scene"
on this link you can hear the problem: https://photos.app.goo.gl/XtpADqHWmaxMnm177