(SOLVED) Persistent Opacity between scenes

nickquest

  • Posts: 60
I have a menu scene with a conditional mute music button called "Music Button 5". When clicked, volume is set to 0% and the opacity of the image is set to 40% to give it a greyed out look. It mostly works except for when I mute the music volume, then play the game in a different scene, then come back to the menu scene. The volume stays muted, but the opacity of the button reverts to 100%.

To try and combat this, I made a number based game attribute set to 1 by default. When the button is pressed and music volume is set to 0%, the game attribute is set to 0. When pressed and set back to 100%, game attribute is set back to 1. So I have an "Always If Game Attribute = 0, set button opacity to 40%". I've tried putting it in the "When Created" event also with no result. I even tried having it in both "When Created" and "Always". No matter what it is reset when I come back to the menu.
Can anyone help with this?

« Last Edit: August 22, 2014, 05:20:49 am by nickquest »

MrWagoner

  • Posts: 424
Hmmm...from what I see in your screenshot I think this should work, especially if it is in the "always"-event... Just to make sure: Does your game have saving / loading blocks? Depending on where you load / save the game, it could happen that the Music Volume Game Attribute never gets saved properly, and is then overwritten again by loading a game state that still has the default value =1 stored in it when returning to your menu. (I had this issue once and it drove me nuts until I got it...)

Check out my newest game: Blowy Fish!

nickquest

  • Posts: 60
Thanks. I will try to add a save in there.  Currently I only have the score information saving.

nickquest

  • Posts: 60
Ahh, yes adding a save fixed it.  Thanks again.

MrWagoner

  • Posts: 424
Oh wow, that was just a blind guess, I'm glad it worked out!

Check out my newest game: Blowy Fish!