How to save and load character stats using Blueprint in Unreal Engine 5?

Hi everyone,

I’m building an RPG-style game in Unreal Engine 5 and I want to create a simple save/load system using Blueprints. Specifically, I need to save:

  • Player character’s health, mana, stamina
  • Experience points and level
  • Current location (position and rotation)

I’ve tried using SaveGame objects, and I can create a slot and save basic data, but I’m confused about:

  • How to retrieve saved data properly on load
  • How to restore character position in the level
  • Where is the best place to trigger loading — GameInstance, Level Blueprint, or Player Blueprint?

Are there any best practices or complete examples of this?

Thanks in advance for any guidance or screenshots!

Hey there :slight_smile:
To answer your questions:

  • You retrieve data by calling LoadGameFromSlot, casting the returned SaveGame to your particular SaveGame type (the one with your custom data) and retreating the data from it.
  • When you create your SaveGame add a Transform variable in your SaveGame class. Add your pawn transform there before saving.
  • You can trigger it from pretty much anywhere you can but in my opinion it makes no sense to be in the level. You want to have different/more levels right? You wouldn’t want to duplicate the code to each new level you make. The same logic applies to any other object. Player Blueprint - do you expect different Player Blueprints - if yes then don’t place it there because you’ll have to copy it. If all Player Blueprints derive from one “base” Player Blueprint, then - yea - if it makes sense to you.

Check Saving and Loading with Blueprints | Tutorial for more.

Create a new save game class, then add all the variables you’ll need. Note you cannot store references, Only simple data.

Use your controller class to Store and Load save game data.

Absolutely limit what you do in Level BP that’s not exclusively about the level itself. Technically nothing non-level related should be in the level BP.