Sorry for the slow reply, just saw this. Here’s what I’ve got:
- Save game variables - I’m using the BestTime and BestTimeArray floats and BestTimeString and BestTimeStringArray variables in my HUD which is where I do all of the Save/Load functionality. The reason for a float and a string is to give me a more streamlined visual of the actual time that only has 2 decimal points.
-
OnBeginPlay - I’m running through to see if the save game already exists and if not, creating one. In there I set the arrays based on the solo string and float defaults. The LevelInt is just an int that I cast to HUD in each level’s level BP and set to the level number. This gives me the index that’s then used for each level to save a best time. I can also use that to decide what level to load on death or level completion (shown below)
-
BestTimeUpdate - Here I’m checking the time the level was finished in (called when level is successfully completed), comparing to saved best time and then updated. I also set a bool to tell my HUD to show a message announcing a new record was set.
-
End Level Options - If the player dies, I used the currently set LevelInt to reload the same level again. All my levels are named the same with just the number after the _ being different to make it easy to keep track of. In the level BP for each level, I set the LevelInt to the level number and that’s all I really need to do. If the player successfully completes the level I load the level called LevelInt+1. Simple.
Let me know if you need any additional info on anything. Hope this helps.