Saving the amount of coins the player has, then getting that value in a different scene

Hi @quantum,

If you are destroying the existing hierarchy on scene change, and loading a new one, a good way to persist data is in a global object.

A common trick is to add it under the browser window object.

For example:

window.Score = {
   coins: 0
};

Now in any script to write to that you do:

window.Score.coins += 3;

To read from that value:

const coins = window.Score.coins;
3 Likes