mute button for all the scenes instead of one scene.

famekraftsfamekrafts Member, BASIC Posts: 834
edited October 2012 in Working with GS (PC)
This is one of the my major headaches.

Now I got a main music file which plays throughout the game.

If I change scene, the music restarts, so I put pause at the time when it changes scene and unpause when it enters new scene.

The problem is Now I need to create a mute button which should work on all the scenes.

for example if I pause music in one scene it should remain paused in the other scene as well. But that doesnt work because the new scene has controller which unpauses music.

So created an attribute pause music and put it to pause.

When I click on the sound button, it changes attribute to true, when it is true the sound should stop. It should also change its image to the mute button.

But my logic is not working.

i have written

if touch is pressed and pause music is false, change pause music to true.

and if its is true, change it to false.

But what is happening is when I touch, it turns into true then instantly into false again, so there is no change, button doesn't change image or pauses music.

can anyone help with a demo or suggestion?







Comments

Sign In or Register to comment.