
You may want to save the resulting object to a variable by using Promote to Variable so that you can easily reuse the object you just created later on. This enables you to use it directly, without a Cast To node. The Create Save Game Object node will automatically change its output pin type to match the type you specify with the Save Game Class input pin. Make sure you set the Save Game Class input pin's dropdown to the class you've created, which is MySaveGame in this example.

This is useful for separating globally-unlocked features from playthrough-specific game data.įirst, use the Create Save Game Object node to create an object based on your SaveGame class. The system supports the ability to have multiple saved game files, and to save different SaveGame classes to those files. Unreal Engine 4 (UE4) features a saving and loading system that revolves around one or more custom SaveGame classes that you create to meet your game's specific needs, including all of the information that you need to preserve across multiple play sessions. Or you may need much more detailed information, possibly involving things like a long list of the player's social interactions with other in-game characters, or the current status of a variety of quests, mission objectives, or subplots. Depending on what type of game you're making, you may only need a few basic pieces of information, such as the last checkpoint the player reached and maybe which items the player has found. The meaning of "saving the game" can vary considerably from one game to the next, but the general idea of enabling players to quit the game and then resume where they left off at a later time is a part of most modern games.
