Webstorage Variables switching on APK?

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I have some global variables that I save in Webstorage for sound toggles, initial value of the variables are set to 0(on)and can be changed to 1(off) with an On Touch event. When I test in browser & CocoonJS launcher everything works correctly, but when I export the game and compile an APK with CocoonJS and the game is installed on a device, the 1st time the game is ran the variables are set at 1 for some reason, if I check the options toggles and turn them on setting them back to 0(on) the settings stay fine from then on when you reopen the game, but it's just that first install the variables are set to 1 so the sound if off by default. I triple checked the variables, they always start at 0 and they can only be changed with an on touch event that is on a completely different screen, not sure what is happening here.

  • The question now would be, does the preview share the same folder as the export?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The question now would be, does the preview share the same folder as the export?

    Are you asking if I'm exporting the same one that I'm previewing? Yes I am.

  • Finally fixed this by putting the webstorage inside of int.

    int(WebStorage.LocalValue("SoundSave"))

    instead of

    WebStorage.LocalValue("SoundSave")

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