Problem with global variables?!

0 favourites
  • 4 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hi everyone,

    So I'm having a frustrating time making a working 'mute music' button.

    At the moment the user presses a button and a global variable gets changed, which then mutes the music on the start-up of other layouts.

    Unfortunately because I am also loading the game on other layouts, the load over-writes the global variable for the muted music and hey presto, the music is back playing.

    a) Am I using the load feature wrong?

    b) Can I exclude the mute music global variable from being overwritten on load?

    c) Anyone got any other suggestions?

    Thanks in advance

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can save the global variable via the WebStorage component and reload it when you reload the game

  • You can save the global variable via the WebStorage component and reload it when you reload the game

    Hi Roberto,

    Can I still use web storage even though my game will be deployed to mobiles?

    I just made a quick test and it works perfectly in the browser but not on the mobile device.

    Thanks!

  • It should work on mobile as well: I never had any issue with saving data, like scores for example, on a mobile device by using the webstorage component...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)