Hello, I am a beginner with C# and unity in general. I have completed the renowned “Unity tutorial for complete beginners” by Game makers toolkit. I started adding more features to become more used to everything but for whatever reason I cannot find a fix to this specific problem.
I followed a few other tutorials on basic 2d additions like backgrounds and particles. I wanted to add a high score function so I followed “Setting and Saving High Scores in Unity” by Night Run Studio. I changed values and such accordingly and I do not receive any errors when the code is ran.
In the image, the large white text is the current runs score, which resets every run (Or fly I suppose). The yellow 0 should change into the current run score if it is higher. This does not happen.
This is the code to change high score.
I used the ‘debug.Log’ line to check if the code is reaching that point, which it is. I also had set the TMP text to blank, on death (Which is when ‘HighScoreUpdate()’ is called) it shows and sets to 0 no matter the current player score.
Sorry if this is formatted oddly, I am not sure the best way to present this issue. Hopefully it is a simple problem. Please let me know if you need any further pictures or details and thank you!


