Local Storage not working in Chrome

0 favourites
  • 3 posts
From the Asset Store
Basic Plugins for Firebase Authentication, Realtime-Database, Firestore, Cloud Storage
  • Hi, Im working in my thesis proyect, and Im learning how to use construct 2 (because I have to make a game without a programer and I dont know how to program)

    and yesterday I was working with Local Storage to save several items, level, score, coins, and more and it worked perfectly.

    Today I wake up to work some more on my proyect and it doesn't work and I dont know why.

    I use chrome, but i read that sometimes thats the problem, so I try it on firefox and it doesnt work either.

    Here is the proyect, I hope somebody can help me.


    Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think what happens is your layout changes faster than values are saved to local storage.

    When level ends, you save a bunch of values to Local storage and without any delay switch layout to "Menu", where on start of layout you read the same items from local storage.

    Local Storage needs time to read/write data.

    I suggest you move all "Local storage set" to event 35 or 36 of your Level 1 event sheet.

  • To leave time and make sure it will always work whatever the saving load is use the actual asymmetric events of the local storage.

    You set your local storage keys to save in an event and in a "On all sets complete" event, that's where you check the conditions of your end of layout and you either go to the level menu or the main menu.

    And you do the same in your "Lost" group.

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