How do I make a Mute Unmute button

Get help using Construct 2

Post » Wed Jan 17, 2018 7:29 pm

Hi ^^ I have a little issue... I upload for my game a music and named it "Theme", I create the sprite of a button for mute or unmute the sound, and do my eventsheet like this :
Image
But when I launch my game and click on the button, the sound just "reset" and worth, I can "unmute" the sound when I click again on it.
Any help?
B
4
Posts: 10
Reputation: 220

Post » Wed Jan 17, 2018 8:05 pm

in the first event give tag""
and then in below events
use that tag to mute sound
Image
B
76
S
44
G
49
Posts: 713
Reputation: 35,368

Post » Wed Jan 17, 2018 8:18 pm

hum, I cant use a particular tag for the sound, and the thing name "mute" and "unmute" is the sprite.
Image
B
4
Posts: 10
Reputation: 220

Post » Wed Jan 17, 2018 9:48 pm

move "set sound to 1&0" to below third
Image
B
76
S
44
G
49
Posts: 713
Reputation: 35,368

Post » Sat Jan 20, 2018 11:23 am

The issue is once the button is clicked it sets the variable from 0 to 1 which sets it back to 0 again in a very fast loop that happens at the click. Basically, every time you click the button the game goes Play Theme, Stop Theme, Play Theme all within a single click. You need to use an Else statement. An example is attached below.
Code
Image

.CAPX
https://drive.google.com/open?id=1AhDQl ... hifO-6E4xF

Hope this helps.
Image
B
51
S
20
G
3
Posts: 209
Reputation: 5,532


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests