0 votes

I dont know how to pause music in background with CheckButton(toggle) please help!
what i need to put in my script.
I use AudioStreamPlayer.
That should to work like that:
When i click OFF (music is off) when i click again ,ON(music is on again)
Pls help!

in Engine by (17 points)

1 Answer

+1 vote

There's a signal "toggled" for CheckButton
connect this signal to where your script attached.

func _on_CheckButton_toggled(on):
    if on:
        AudioStreamPlayer.play()
    else:
        AudioStreamPlayer.stop()
by (805 points)
edited by

I have sent.

Ok,i download that,what now? :)

Unzip it and put it in a godot project. Since I don't know your game world, you can't just copy the sample scenes, that won't work. You can open it and see how it works and go to your own scene and fix the problems. It's late here, I have to sleep now. If you have further questions, you can reply back in email.

Okey,thanks and good night...i will send you question on email

Hi is there anyway you can add the solution here because I am also having a similar problem

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.
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 webmaster@godotengine.org with your username.