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.

in Engine by (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)

by (5,274 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.