Game instance variable reset

So i have a health variable in the character and the same health variable is stored/updated in the game instance. If you die in a level, you have the option to quit or restart. If you restart, it takes you to the beginning of the current level, where the game instance health variable is reloaded. The problem is that when you die, your health variable is at zero, so the game instance restarts the level at zero, because that is what was stored.

I could, of course, have a regular private health variable just update at begin play, but there are pickups in levels that increase max health permanently in both the character and the game instance, so i cant do that.

How can the game instance health reset the current health variable to the current max health amount? Any help appreciated and i hope i made sense!

Hi @TLOA ,

Maybe if you haven’t, you should differentiate your “Current Health” and the “Max Health”. When you pickup the item that increase permanent HP, you can update the Max Health value (or Both of the health var). And for Die checking, just use the “CurrentHealth” variable to check. You can also set your CurrentHealth to the value of MaxHealth in the beginning of the game. I think by doing that you can avoid 0 HP at the start of the game.

please reply if its not the case

That does it! Thank you!!