Why aren't my variables saving (BP Structure)

Im at a loss on how to get this to work. Before going in and fleshing out my game systems, I want to figure out saving game variables. My players attributes are built within a structure & blueprint component, but I cannot get the variables within to save.

I know the “save game to slot” is working, as I have the file on my disk - but the variables are not saving. I’ve tried working this with a “GameInstance”, I’ve tried with a “GameMode” - but nothings working. I’ve followed multiple different tutorials (none of which use structs) & inserted my struct where applicable … so I clearly must be doing something wrong.

I thought it might be how I have my structure set up. Variables such as “Health” are in the component as the type “S_Attribute” (my structure) but i’ve tried saving the struct as a whole as well as the individual attributes - neither save.

I’d greatly appreciate any help or pointers, this seems like it’d be a fairly simple task but I’ve been stuck on it for atleast a week.

Heres the save logic:


This

image

needs to be ‘player save data’.

Here’s a save game 101

You should save the instance where you set the variable:

But it’s better to do it:

My Products

I appreciate the response! That “Game Save” variable is set as GameSaveData, but nevertheless I tried both tips & the S_Attributes still is not saving/loading. As for the second photo, I did pipe in the “break attributes” into “make attributes” from getting the component for attributes.

A bit more context on my set up: obviously my structure is set up with floats: base/delta/multiplier/max. The functionality itself is in a blueprint component; which is using a gameplay tag system, listening for tags/changes to attributes ect. The attributes themselves are variables within the component, set as the structure “S_Attributes”

So I have debug commands for saving the game, loading the game, and changing my “health” attribute. I’ll start play, lower my health base value, save the game (string prints & the file is in my project folder), lower my health more, press load (string prints) and nothing happens. Close out of the play session & re open, health value is now back to 100 (full).

I have the “load player data” executed in my “event begin play” & under maps & modes I have the game instance set to the one I created.

Still fairly new to unreal and programming in general. So I’m wondering if I’m targeting the wrong thing for saving the attributes. I really don’t understand what I’m doing wrong xD

Appreciate the response.
That “Game Save” variable is “Player Save Data”, the name of the variable is just wrong but its set to “player save data”

At any rate, I still cannot get the variables to save. More info in my reply to “Supremative”

Could you please show the last graphs where you load and save your SaveGame object?

I got it working, at least with saving the variables & loading them upon “play game”. After following your second picture, I just had to move the “load player data” function to the front of my characters “event begin play” code.

Loading from a keyboard command doesn’t work, which is fine for now, unless its conceptually the same as implementing a load from the main menu. I’m just happy that I got the variables to save.


Maybe you forgot to enable input: