how do i make lives for my player

Im making a Sidescroller, and im trying to make a simple way of setting up lives. i have an integer variable storing the value in the player blueprint. Everything is working correctly, but whenever my player dies, the lives counter goes down to 2, but when he respawns the counter goes back to 3 again. I have a custom funciton which re-opens the current level if the player gets killed, which is how im currently handling respawning. It seems that doing this resets the variable back to its default value. I also tried making the value 0 and setting it up in EventBeginPlay, but it still had the same result. Does anybody know how i can keep the same value for the variable in the players blueprint when the level is reopened?


Could you provide screenshots of your blueprint setup? Most importantly I’d like to see how you are setting your Lives variable. Thank you.

Hi man, Its normal.
When you reset the level that restart as the first time.
I think you should rethink your workflow , but if you really want to keep all this way,
Here a video about use “persistent variables” . Hope it help you.

Otherwise here a question about save on file your variables