How do I make a save/load game where If I quit the game and come back and click on Load Game it loads from where I left my character?

So I have a game and I want to make the Save/Load system. Ok so I click start the game from the main menu and in a point of my time i must pause it, in the pause menu i have a button called Save game where i click and if i want to quit the game, after, i click quit game.

When I come back and want to continue from where I left I have a button called Load game in the main menu, and when I click it , I want to load the exact location and the exact level where I saved the game.

How do I do that?

  1. Create a new Blueprint, based on the Game Save Object class, call it something like MyGameSaver
  2. Add a string variable to the MyGameSaver called “LevelName”.
  3. Add a Transform variable to the MyGameSaver called “PlayerTransform”.
    DO THE FOLLOWING STEPS IN YOUR GAMEINSTANCE:
  4. In your Save Game action, have it Create a Save Game Object of your class MyGameSaver, then use the Get Current Level Name node to set the MyGameSaver object you just created’s LevelName variable, and use the GetActor Transform node from your player pawn and/or its Controller Rotation to set the MyGameSaver object’s PlayerTransform variable.
  5. After that, have it use the Save Game (Or is it Save Game to Slot) node to save your now-populated MyGameSaver object to disk.
  6. In your Load Game action, use the Load Game (or is it Load Game from Slot?) node - remember to use the same string for the save file name - and cast the returned object to your MyGameSaver class, and then you can get the PlayerTransform and LevelName values from there. Use Slot 0 for both save and load. I don’t know what slots are for. 0 works for me.
  7. After that, in the Load game action, Set a Transform variable in your GameInstance “PendingPlayerLoadTransform” to the PlayerTransform value from your loaded MyGameSaver object.
  8. After that, having it use the loaded LevelName value, use the Open Level node with the LevelName value as the name of the level to load.
    NEXT STEP HAPPENS IN THE PAWN OR PLAYERCONTROLLER BUT COULD WORK FROM OTHER PLACES MAYBE:
  9. In your Pawn class on the Possess event or the BeginPlay event, first thing you do is check your GameInstance for whether the PendingPlayerLoadTransform" is set to anything other than 0,0,0 or whatever the default value is. If it is, then Set Actor Transform or Set World Transform on the Pawn to be what that PendingPlayerLoadTransform value is. And if needed set the Player Controller’s Control Rotation to match the rotation part of the Transform.
  10. After that have it set your GameInstance’s PendingPlayerLoadTransform value back to the default 0,0,0 0,0,0.

I haven’t tested this but I think it will work.

Hello mightyenigma and thank you for your answer I’ll try this method right now and I’ll tell you if it worked or not!

What do you mean with “Save game action” ???

I mean whatever piece of code you create to make the saving of the game happen like maybe a UI button click event or a function in a playercontroller or maybe a trigger volume overlap event in a level blueprint. Whatever you have done to cause it to save the game.

I have th same question and i have solve it with this : Unreal Engine 4 - Charger & Sauvegarder - YouTube