Changing Music Volume w/ Actor Alpha Channel
dominic.koponen
Member Posts: 22
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?
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
-
JohnPapiomitis Posts: 6,256when 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