Download

Save High Score not working

I followed this tutorial for everything except counting the mouse clicks. Instead I used a cast to my HUD to get my high score to save. The high score does update correctly in the HUD.Unreal Engine, Save & Load game data - UE4U.XYZ - YouTube
There is a save file that has been created but the high score always defaults to zero on a new game. The attached BP is in the Level BP.
Any thoughts on where to look?

I think that’s because you’re setting it from the same place. If the High Score is default 0, then when you load the save game you’re setting it from the default and then saving it right away. You would need to set the HUD version from the loaded save game if the save file exists.

This thread in AnswerHub might help.

https://answers.unrealengine.com/questions/84785/tappy-chicken-score-system-for-multiple-maps.html

Gooner44 is right. You are setting your high score when the game begins. For your graph above, you should only load (get)the value if the save gave is valid. If there is no saved game, set the HighScoreNumber to zero (which I’m assuming your HighScore variable is by default) and save. At the END of play, you should compare your current level score to HighScoreNumber. if you level score is higher, then save that value into HighScoreNumber and save. If not, the leave HighScoreNumber as-is and you are golden.
So, the first time playing your level, assuming you score something, your level score will be higher than your saved score and you can update then and resave.
Make sense?

Thanks cats, I was sure you were right. I tried moving it directly into the HUD but that dog would not hunt. It is cool and I am not going to worry about it for now.
This project started as a proof of concept to see if I could build something somewhat original with my weak coding skills and even though I didn’t get save game working I think I am going to try and clean things up for it’s final destination on a mobile platform. I love how clean Tappy Chicken is and I am going to try and copy that. Thanks for the help. I love this engine and this community.