load menu and load and save system

Hello, I have implemented a load and save system that works in my level that is similar to Ali Elzoheiry’s The ultimate guide | How to Save & Load your unreal engine 5 game | ue5. And a regular menu setup with a different game mode and pawn. I have been looking for an answer, so hopefully someone can explain it to me. I use the first-person horror variant in 5.6, as I can’t connect the load button with the menu, since there is no reference to my player pawn. So, I can’t load the save at all, even though it exists. I was wondering if there was a workaround to it. The save and load system is based on a data structure and a game instance that is for all levels.

Hey @MARZ64331 how are you?

The best thing you can do here is to store the save data in your Game Instance when you click on your “Load” button instead of referencing a pawn there, and then call Open Level to start the game. Then, in your pawn’s “Begin Play”, you read that data.

To do it I recomend you to follow these steps:

1) In your Game Instance:

  • Add two variables: a boolean calledbPendingLoad and a string called PendingSaveSlot

These will survive the level transition automatically, since the Game Instance persists across level loads.

2) In your Menu Blueprint, on the Load button’s OnClicked:

  • Get Game Instance (cast to your Game Instance class)
  • Set its bPendingLoad = true
  • Also store the save slot name string in PendingSaveSlot
  • Then call Open Level to load your game level

3) In your Player Pawn:

  • On BeginPlay, get the Game Instance and check if bPendingLoad is true
  • If it is: call your existing load function using the PendingSaveSlot name, apply the data to the Pawn, then reset the flag back to false so it doesn’t re-trigger
  • If it isn’t: start a fresh game as normal

With this you should be able to load all the data to your pawn without any issue!

Let me know if it worked or if you need more help!

Unfortunately, it did not work for me as the whole system depends on the pawn to get the information, so I made it so that my pawn is now the pawn in the menu, so it now loads but it does not put the player into their last position


it does work if I press load and then press my pause button and load saved game then it loads last position

solution was this

the only issue I have left to work out is saving the inventory and current health but overall, it works