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

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    just turn the volume off. You should not need to use pause and unease though. If you just start the music in your intro screen and never change it again it will just play forever. Then you can control it all with the music volume attribute. Either way though turning the volume down will shut it off until you turn it back up.

    Cheers
  • famekraftsfamekrafts Member, BASIC Posts: 834
    Will give this a try, thanks.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    also check out this video for a super simple on/off button

  • famekraftsfamekrafts Member, BASIC Posts: 834
    Thanks man your first solution worked, will check out the video.
Sign In or Register to comment.