Best way of storing a Death Count value when resetting the level?
In my game, you play as a ball trying to get to the end of a complicated level but if you fall you die and the level gets reset. However, I want to be able to use my death counter but obviously due to the level being reset, the death count gets reset. I attempted using DontDestroyOnLoad and storing the variables in a game object that wouldn't get destroyed but that didn't get past the count of 1. Making the variable static did keep the death count but if I go to the main menu and back to the same level the value would not have reset. So what options do I have?
Your answer
![](https://koobas.hobune.stream/wayback/20220612131101im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Change positive to negative negative to positive 2 Answers
Change a variable value for 5 seconds 1 Answer
Changing a variable value 2 Answers
Make a float variable change when another variable changes? 1 Answer
Increase value by one each second [C#] 3 Answers