How do I save characters to a save game so that I can spawn in with the same character that I chose even after leaving the game?



I have a player selection where I select characters and can play as different characters on overlap events. I can change the character but every time I log back in to the game I get set back to my original character. Can someone show me how to connect my previous code of me setting the character to a save system so I remain as the character.

I don’t see any code to load the save game there.

If you’ve saved the character config to the save game, when the character is spawned, it needs to load that config and use it.

ccould u show me an example

Save game 101 looks like this

Im just confused on how to save a an actuall character like what would be the variable type in the save game and would I save the game after my set character node? I just never saved an actuall pawn that would posses before. Just mainly on where do I place the things you listed above like in which blueprints. Kind of help me connect what you stated above to what I already have a little more plz.

okay I just realized that my variable is being held in a game instance instead of a save game maybe thats why Im confused. What should I do

You can’t save the character, you can only save variables. So if you have, for instance, a health variable in the player, that goes where the integer variable is in my example.

If you want to save the player location, you save a vector, and so on.



So I have tried this but it still doesn’t seem to work, where did I go wrong?

At a first glance, the save code looks ok. But none of it will run, because you’re destroying the actor ( naturally, everything gets destroyed, including all this code ).

I removed it and its still not working

The code works, please check carefully.

Is your save game in the folder? ( projectname/saved/save games )

yea its there

turned out that I wasnt spawning in the character to be able to posses it so their would be no character for me to posses and I pulled from the charactersave game to get the character I needed to spawn in thanks for the help

1 Like