How can i make a mute button?

Hello. So i dont really know what iam doing wrong. I have made it in different ways already… Basically i press the mute button and plays again and again the music without stopping it. I think its because the 2 events with mouse button down in the same object, that is why i made “if all of these conditions are true” but it does not seems to work. Any idea? Thank you for your time :slight_smile:
PS: By the way… I use the action play a sound instead of play a music file because play a music seems bug or something… it doesnt work to me.

1 Like

The problem is that both events will be triggered every time, so the first one mutes it and instantly the second one unmutes it. There are two easy solutions:

  1. Put the muting event after the the unmuting event
    or
  2. Add a condition to check that the animation of Mute =0 in the muting event.

It might also be better to check for a mouse button being released, rather than pressed, otherwise there may still be time for both events to be triggered by the same press.

I did what you said. I moved the muting event after the unmuting and didn’t work. I used the condition to check the animation of mute = to 0 and didn’t work :frowning:. When i play and i mutes it… it works… but then i cannot unmute it. I made some variations too on what you said and it didn’t work either. I am kinda lost now hahah

Hello! I had the same problem, so I did a timer for the wait time of the click, then it worked, you could try. ^^

Here’s another way: [url]on/off Button for Background music]

Thank you so much to all of you. I already solved the problem with your help. Have a great day :slight_smile: