I’m working on an endless runner. I’ve got coins and high score displaying on my HUD widget but the high score resets after a second of retrying once the player dies. Can’t figure out where this is happening. I also cant get my debug to work so I cant use that to pinpoint where its resetting.
On the EventBeginPlay off the TRUE branch you don’t save your file again after you load it, as a result your HighestCoinCount (derived from the Save Game) doesn’t get saved anywhere, because… The variable HighestCointCount you save in the High Score Check function in not the variable that exists in the Save Game but rather the variable that exists in the blueprint you are in, so basically the SaveGameToSlot you perform in the end saves a HighestCointCount (the one that is in your SaveGame) with a null value. So when you load it again, it is null and never changes value because of what I described above.
Solution: In the High Score Check function you should be also getting the SaveGame blueprint and from that call and Set the variable HighestCoinCount and then SaveGametoSlot.
Thanks heaps I fixed it and it’s saving my high score. Your a life saver