Save Game in Unreal Engine 5 Saving Coins & Score

  1. Create SaveGame class
    • Right-click → Blueprint Class → SaveGame → name SG_Player.
    • Add variables: int CoinCount, int Score.
  2. Add player vars
    • In your Character BP add int CoinCount and int Score (defaults 0).
  3. Save flow (when you want to save)
    • Node chain: Create Save Game Object (SG_Player) → set CoinCount = Player.CoinCount, Score = Player.Score → Save Game to Slot (Slot Name: "PlayerSave", User Index: 0).
  4. Load flow (BeginPlay or Continue)
    • Does Save Game Exist(“PlayerSave”,0)? → if true: Load Game from Slot → cast to SG_Player → set Player.CoinCount = SG_Player.CoinCount and Player.Score = SG_Player.Score → Update UI.
  5. Update UI
    • Either bind Widget to Player vars or create UpdateCoins(int) / UpdateScore(int) in the widget and call them right after loading or after changing values.
  6. When to call Save
    • Call Save on coin pickup, on checkpoints, on level complete, or on game exit. (Prefer checkpoints or explicit saves to avoid heavy I/O each frame.)
  7. Use GameInstance for cross-level
    • Put SavePlayerData() / LoadPlayerData() functions in your GameInstance to keep logic centralized and accessible across levels.
  8. Test
    • Play → collect coins/change score → trigger Save → stop → Play → Load → confirm values restored.

Pro tips (quick):

  • Use Async Save Game to Slot to avoid frame hitches.
  • Add a SaveVersion int to SG_Player for future-proofing.
  • Use unique slot names for multiple profiles (e.g., "PlayerSave_1").