Need Help Saving High Score Float Variable (Blueprints)

I am making a game in the RollingBall gamemode, and I have a scoring system setup that is showing your current score on your HUD and then when you “die” this menu pops up and it displays what score you just got and your all-time high score. I’m pretty sure all I need saved is the high score value. I have everything setup working great except it keeps reseting the high score back to default value (0) everytime I either hit the restart button on the in game menu or stop and play in the editor. So when you “die” the high score always shows the same as the current score (I have it setup using "if current score is greater than high score use current score to set high score* maybe thats the problem?) I have tried for weeks to get save game objects to work but nothing will… Please help. Oh, PS, these variables are floats if that helps any & both “scores” are default value 0.

What does your saving and loading code look like?

Do you actually properly save the savegame object after changing the variable?

And load it before you read it?

Well right now it’s jumbled and trash, I’ve tried like 6 different ways and nothing has worked. And I don’t know about the other stuff I don’t have a way of testing that

In the save games folder that it saves to automatically it did create the file but still doesn’t work properly

Read through all of this:

Implement the blueprint version (there’s a link to a guide at the bottom). If you still have trouble afterwards.

Update this question to show the code you have and try to describe the specific issue. Which part isn’t working? Check if everything is being executed, etc.

A list of useful tools for debugging (so you can track down where exactly your issue is) can be found here:

Okay, I tried to get screenshots of everything that has anything to do with this. The part that is not working is it is not keeping the value of my high score float var after a level reset/load. It always displays the high score as the same number as the current score.

First of all. You need to create the savegame outside of the savegame object.

While it doesn’t exist, there’s no way for you to use that code.

Secondly. Your savegame is by definition not your ball / character.
A cast is only asking if the input “Object” is of the type X in “Cast to X”.
Your newly created savegame is definitely not your ball meaning everything behind the cast won’t be executed.

Third. You do not need to create a savegame object before loading. As the documentation says that’s only done in this example, so the savegame exist.

In actual code you check whether it exists with “Does Savegame Exist”. If not, there’s nothing to load. Maybe you want to create one so for future reference or when you want to save something in the future. If it does, then you load it.

I would suggest storing a savegame variable in your player controller or player character. Have the code in the same class and only use the savegame variable for your highscore. There is no need to have a “highscore” variable in your character and copy it over all the time between the two.

So I don’t need anything in my Save Game Object? And where do I start the load from slot at on the load from slot node? and do the load from slot and create save game objects need to be connected to anything like on event begin play or anything to get them to execute? Sorry Im pretty noobie at this saving thanks for all the help!

Okay, sO update after doing what you said as best as I could, I got it saving and at least finding the save (according to print strings) But it still is not actually saving the right data or something cause my high score is still showing the same as the current score.

Did you get it to work? I have the same problem. How ever I run all my Coin Count Text Widget trough Game instance. Unfortunately the coins are constantly adding. So previousy collected coins and current coins nothing but adding together. I was wondering how would you tell the Game instance to only replace current Coin Count if X is greater then Current High Score and do nothing if X is lower then the High Score.