How to save float, rotator, etc to savegame?

Hi everybody

So I got a menu template from the store that also includes the possibility to save a game. Right now it saves player position, game name, time/date and play length. Also, I think I more or less get now how saving works - in theory.
But, no matter where I create my blueprint stuff (Game instance, directly in the savegame BP from where the posted screenshot is, or wherever) I’m not able to get the “Set” thing with the target nodes. I need the target node in order to hook it up to the save game (as seen in the screenshot, is done with all other data).
It doesn’t make any difference if I create the variable in the very same blueprint, or in another one and make public or cast to it, I always get the “normal” “Set” without the target node. Tried it with getworldrotation, a very simple float and much more.
So, my question seems to be:
How do I get and store any variable with the blueprint in the sreenshot. Best situation would be, to be able to use any variable from any blueprint, without having to create the function in the savegame blueprint from the screenshot.

It’s possible it has something to do with an “option”. All answers I was able find say that these are “options” from within a certain blueprint. If this is the case - how do I create an “option”?

Thanks for any help!!

Thanks a ton! Such a small but big detail… This solved my initial issue!

I think I will create another post - but now I’m stuck again. I have stored the variable in the my save game blueprint. I did set the default to “1.0” - but when I print it to the screen I always get 0.0. I even added a button that should set it to 2.0, turn on a light and then print the variable. Again it’s 0.0. As the light turns on and something is printed, I can be sure blueprint runs through. But it seems not to affect the variable.
The screenshot is the part of the button blueprint that should set the variable to 2.0.

You have to open the MySaveGame blueprint and add the variables in there.

Where did you set it to 1? In the save game blueprint?

Yes I did. And even if I would not set it - the blueprint in my recent screenshot should set it to 2.0, right?. Of course I will have to save ot afterwards.
Besides, the screenshot is not from the savegame blueprint - it’s from the blueprint of the button that should set it to 2.0.

Yes, you don’t usually have any code in the save game.

Setting it should work, even if you haven’t saved it for later.

Here’s my save game 101:

and a link about it:

Many thanks! And let me say, your help is very much appreciated. This forum is still one of the best forums with one of the best communities I ever came uppon.

Maybe my last comment wasn’t clear.

There’s no function in my savegame - just the variables. Anyway, saving the float should work now thanks to your help. But my current problem is, that I’m not able to set the variable to a specific amount & the default amount is also ignored. Setting the amount is done outside of the savegame blueprint. Please see my screenshots bellow:

My Savegame blueprint:

(1.a) Here’s the variable, added to my savegame.
(1.b) Here I have defined the default value - no function was added to the avegame as you can see.

Other Blueprint (Lamp Blueprint) that is a button & a light, that’s turned on on button press. What I know try to do is additionally set the “savefloat” variable from the savegame to a specific number (2.0 & 4.0 in this example), based on if the lamp is on/off. Then it should print the value of the variable. But I always get 0.0. The problem seems to start even sooner. On begin play I already check the amount & get 0.0 - even if the default amount was set to 1.0 in the savegame blueprint:

(2.a) Here I print the value on begin play
(2.b) You can ignore the rest. That will set the lamp on if the “savefloat” is set to 2.0. But first, setting the value has to work
(2.c/2.d) Here I try to set the value & then print it. It also turns on the lamp on button press - turning the lamp on works just fine. But the amount stays on 0.0.

As a little explanation - this is for now a test. What I want to do is to store many many such floats based on actions the player did, like pressing a button. I need this to be numbers. In the the end all numbers will be randomized to a certain degree - that’s why every action & save needs to be based on a number (float).

So - why does the float always show 0.0?

Cheers

The only dodgy thing I can see in your graphs at the moment, is that you shouldn’t ‘cross feed’ between them

You can’t get the float from the lower graph and feed it into the upper graph, because the lower graph needs to be running ( or have run ) to make the save game available to the upper graph.

So best to take your float from the save game that you’ve cast to in the upper graph, for the upper graph.

I don’t know if that helps?..

Unfortunately, changing this didn’t help. I think I will now make a new post with the current issue.

But thanks anyway for your help!

I Made This And IT Works