0 votes

Hey,

I am trying to make the audio play over a certain amount of scenes. Like I want it to play on scene 1 and when the game loads into a scene 2, the I wish the audio to continue to play, but from where the audio left off on scene 1, but when scene 3 is loaded then I don't want the audio to play at all.

Thanks in advance and any help appreciated.

asked Mar 10, 2019 in Engine by Kyle J144 (32 points)

1 Answer

+1 vote

You'll want to use something like an Autoload singleton. http://docs.godotengine.org/en/3.0/getting_started/step_by_step/singletons_autoload.html

It may be some TSCN that has your audio nodes on it, and can serve as an audio manager for your game. It will persist while the game is up, and using this method you will have a globally accessible name for it.

AudioManager.play_music()

You can also manually add / remove your own Nodes or Scenes to the tree by attaching them to the root.

get_tree().root.add_child(my_node)

answered Mar 11, 2019 by avencherus (4,833 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.