Hello everyone. I am trying to set up a basic save/load system. The game should save when the player picks up the item which is set as a game objective. And it should load from the main menu.
I am currently testing this function with my HP only before I set up anything else. So if my character is, let’s say 50 hp whenever he picks that item up(and the game saves), he should start at 50 HP when I click “Load Game” through my main menu. Here is a screenshot of my menu widget and one from the objective-save item. My issue is that the load button restarts the level without saving the HP I had at the time of saving.
Okay first when u create a save object, u don’t need to create another one on top of it… I think it’ll overwrite everyone… Second, don’t make it so it saves every time u do an action, I tried that and I had a million problems that I didn’t know how to solve… Here is a good way to use save load system thingi, when loading a game make it so it will copy all the variables from the saved object to a game instance, and during gameplay all the changes in variables should be changed in the game instance, when the player wants to save, it copies all variables from the game instance to the save object… boom problem solved! Also if u have alot of variables, it’s better to use ASync Save node.
thanks for the answer. I figured out how to load the data if the loading button is on the same level as my game level. But what do I do when I want the loading to happen through my main menu which is on a different level?
Game instance… HTF do I? Use the GameInstance Object in Unreal Engine 4 - YouTube This guy explains everything about game instance, it’s really simple…
I see what you mean. But as he says the game instance does get destroyed when the game closes. So how do other games let you load a level from a different map, even if you have closed the game since the time you saved?
What? No the variables in an instance reset to defaults when the game closes, the thing with Instances is that variables does not change when opening a new Level, unlike actors the variables reset when opening a new Level. Also I didn’t understand ur question, when I say Level I mean a world level or a map… same thing… U use “OpenLevel” node when u want to load an new map or a world…