How to render my saved variable?

hey, i want to render the score u got in an other level. So i created the game instance. everything works till there! Then i wanted to save the values of the variable “max (player)score”. the max score is ur highscore. And when i reopen this game it should show u ur highscore again. But it tells me all times an error about the return node of the function, which is binded by the Text.

Check how you set your «save ref» variable. You try to push a «create save game object» on false and you use the return value directly after, but if the save game object exist you still try to take the return value from your «create save game object» which obviously doesn’t exist.

So in resume, make sure to use «load save game from slot» if the game actually exist.

Also the value you take from the game instance «You was in game» will always be by value by default (so if it’s set true, the game will always run the true branch output are vice-versa).

firstly thanks for the fast answer.

i changed a bit the nodes.

if i start the game the first time, it does not load or save.
if i finished a round it creates a save game object
If i reopen the complete game it load game from slot, if i allready played a round

everything fine!

But if i have to save the game the second time i really dont know if it works. i think this is what i can solve by myself maybe.
the only big problem is that i have to know how i can remove the errors what appear every time i start the game. it doesnt deppends when i come to the menu

ah ok, i understand now what u mean, wait a bit…

ok, i dont get it, it feels like i need a “get all save game objects” function. Im looking for a tutorial. I understood the normal tutorials for save/load like this Save/Load Game System Intro - #66 Unreal Engine 4 Beginner Tutorial Series - YouTube
But this is a bit different

ah ok thanks

The errors are because your main menu has a text property trying to read from the save game before it exists. Put a isValid before you try to read the property

ok solved now