Hello i just wanted to ask if anyone knows how to save score when stopping the game i made that when you kill enemy that score is going up by 10 and when you kill and kill it is going up but when i stop the game to edit or try something its going back to 0 can anyone help me how can i make so there is score and high score and then when you die or you stop the game high score is your best run but score resets to 0 like it does
the first picture is from Score Script and second picture is from Enemy script
ScoreScript.scoreValue += 10 isn’t getting called at all, you are completely deleting the object this script is on with Destroy(gameObject), put ScoreScript.scoreValue += 10 above Destroy(gameObject):