Changing Music Volume w/ Actor Alpha Channel

dominic.koponendominic.koponen Member Posts: 22
edited May 2012 in Tech Support
Hello,

I have an actor that has another actor that I would like to control. My current rule is:

To Turn off
If:
Actor receives touch, and Game.Audio.Music Volume=1
Then:
Change Game.Audio.Music Volume to 0 and Change Scene->Layers-> Actor B Alpha Channel to 0

This will turn game audio off and hide the image that indicates volume is on. It is working perfectly when I have this, I can turn the audio off and it will work fine. However, if I apply ANOTHER rule to do the opposite(turn back on the music volume), it somehow conflicts with the first rule and then NOTHING works?!

The second rule that supposedly should turn back on the volume is:
If:
Actor receives touch, and Game.Audio.Music Volume=0
Then:
Change Game.Audio.Music Volume to 1 and Change Scene->Layers-> Actor B Alpha Channel to 1

How do these conflict at all? How can i fix this?

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    when touch is pressed
    -change game.audio.music volume to (game.audio.musicvolume+1)%2
    -change self.color.alpha to (self.color.alpha+1)%2

Answers

  • dominic.koponendominic.koponen Member Posts: 22
    John, this is EXACTLY what I needed!! Thank you very much it worked perfectly :)
Sign In or Register to comment.