Hello, I have a game where you can get coins/gold each time you play. Kind of like the coins you collect in Subway Surfers.
I then tried to get the gold/coins I get in each stage to add to an integer variable, basically serving as the money you can use to buy stuff in-game.
However, I seem to be getting something wrong in my scripting and only end up saving the gold I earned in my last play (they don’t add up like I want them to)
im no expert on save games but dont you have to tell the save which things to save? like in the game save object you would create variables for each thing you want to save then set their value prior to the save to slot.
Game Mode is not a persistent BP. You can’t store the “score” in the game mode for the purpose you want. Every time you go to a new stage the “score” in the game mode will be reset to default. So when you save it at the end of the stage it will only ever be the score of that current stage. If you want to track score across stages/levels use a BP like game instance. That persists through level transitions.
Hello, sorry for the delay in response. I noticed what I was doing wrong. I was not loading the Total gold integer upon starting the new stage so it was constantly resetting. Sorry about that.