How to retrieve multiple variables from LocalStorage?

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I want to set the game progress values using arrays so that when the player returns to the game, these values are restored. Although the values initially seem to be restored successfully, they eventually revert to the game's default values.

    DEMO:

    Here’s the way I have it set up currently:

    Could anyone provide some solutions to this issue?

    Thank you so much!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On the first screenshot - remove "Wait 0.2" and "Wait for previous action to complete", they are not needed.

    On the second screenshot - you are saving values to Local Storage on every tick, this is a big no-no. Local Storage operations are asynchronous, they require time to complete. You are basically reading and writing values in Local Storage at the same time, this is why they reset to default.

    You should only save to LS when it's safe to do so. For example, at the end of the level.

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