Thanks for the reply s both of you. Really struggling to get my head around the saving n what not.
I managed to get the health of the player to persist between levels by using a GameInstance with a health variable. Then cast to that.
Like so
But I honestly don’t know how to get the SaveGame blueprint to save more than one piece of information at a time… I’m probably just being slow.
I managed to make this
So I could create a save when I hit a checkpoint. It doesn’t spawn the player at that location on next play however.
And I can only figure out how to get it to save one piece of information.
I need it to save, the players location, current health, unique keys collected, and what level portals have been activated.
I can’t find any information online that explains how I can go about doing that.
So, I think its best I show how I have implemented the keys so far.
I have one base class for all the keys. Then for level one, two, three, four, five and so on, I created a child blueprint. All the child blueprint does is swap out the mesh/material if needed, and assign a different number to the “Key Number” variable.
Assigning a different number to the keys allows the player to collect however many needed keys for a particular level portal. For level three for example, you need three, level three keys to unlock it.
So. Base Key class
You see the branch checks what number is assigned to the “Key Number” int var, then increments that in the players variables. As seen here.
This works to open the portals. But I doubt its the best way of doing this as I just made it up from the top of my head.
Its probably way too simplistic.
The problem I have is that I can’t figure out a way for the unique keys collected to be saved between levels.
I think its worth noting that the order of the key collection is in not important. For example, you might find a level 4 key on level 1, 2 or 3. So it needs to save which physical key was collected, not how many. So that the player isn’t able to just re-enter the level and collect the same key over and over.
If anyone has any ideas how best to go about doing this, any help would be much appreciated.