How do you save GameInstance?

GameInstance exists for as long as the game is running. Exit the game and the data is lost.

SaveGameObject gives you a chance to save the data directly to the hard drive and load it back again. The data does not have to be in the GameInstance. However, the GameInstance does persist when you switch levels which makes it a very good place to handle the saving. Since most blueprints have access to the GameInstance, it’s convenient to manage SaveGameObjects there.

The original docs:

And to answer your question directly: you do not save the GameInstance. You use a SaveGameObject to save data to the hard drive.

1 Like

Hey All, I’m just trying to figure out the savegame functionality of unreal

I currently have a project where I’m storing core user data such as name/health in a GameInstance

My question is, how can I save this data so it can be loaded when I close/open the project? I found a great tutorial which covers gameInstances (UE4 - Using Game Instances & Persistent Variables - YouTube) but it doesn’t go into detail about how to actually save the data inside the gameinstance once the game is closed. I have found various tutorials on saving/loading games, but they all involve creating a ‘saveGame’ blueprint, but I’m unsure how this type of blueprint is different from a GameInstance, and if they need to work together??

Thanks @Everynone. So am I right in thinking that I use the SaveGameObject to call/save the variables in the gameInstance? ie. I currently store the player name as a GameIntance, would I then call this into the SaveGameObject and save it from there?

Yes, you can make the GameInstance into a hub that gathers and pushes data into the SaveGameObject.

The link doesn’t work anymore.

Fixed.