This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

My game has 2 scenes (Main and Title).
Sounds (and Music) added via AudioStreamPlayer.
I need to create a button, when you click on which all sounds (and music) will be muted, and if you click on it again, it will be played further. How can i do this?

Godot version 3.3.2
in Engine by (18 points)

1 Answer

+1 vote
var bus_idx = AudioServer.get_bus_index("Master")
AudioServer.set_bus_mute(bus_idx, true) # or false
by (1,406 points)

Ty, but
With this function I can only turn off the sound, but how can I turn it back on?

func _on_Volume_pressed():
var bus_idx = AudioServer.get_bus_index("Master")
AudioServer.set_bus_mute(bus_idx, true)

You change the true to false.

Can you write code please, just i'm so stupid ;3

For me it's working thanks.

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.