Saving Your Game

Overview of how to save and load your game

On this page

A simple way to set up saving and loading in your game is to use a SaveGame object.


Think of the SaveGame object as a box with different compartments. You set up each compartment to store a particular piece of information by creating variables. For example, you could create a variable to save the player's score, as well as the player's name. You can transfer information into the SaveGame object from other classes, like your Character, PlayerController, or GameMode. To do this, first you must create an instance, or copy, of your SaveGame object.


Then, for example, you can take the values for the player's score and name from the PlayerController, and store them in the matching variables in the SaveGame object.


The SaveGame object will now hold on to these variable values until it is saved to the hard drive.


Finally, you can save out the SaveGame object to a file on your hard drive by using SaveGameToSlot. This works just like saving a document or a new game in other programs, since you give SaveGameToSlot a file name. By default, save games are stored as .sav files in the Saved\SaveGames folder. You also must give SaveGameToSlot a user ID, which will help in looking up the information to load later on.

Loading information from a SaveGame object is also a simple process, which is almost the reverse of saving information. You use the LoadGameFromSlot function, which takes in the file name and the user ID as input. Loading information from the hard drive with LoadGameFromSlot creates a new copy of the SaveGame object.


You can use this object to copy information into other objects and Actors in your game. In this example, we are loading the player's score and name into the PlayerController, much like you would when a player opens up a saved game and begins playing again.



To learn more about saving games using Blueprints or C++, use one of the following links:

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback