Help Making A Score Counter

Hello, I’m making a tapping thing where you tap and get 1 coins and those auto things.I’m pretty new to unity. I can’t get the code right where if it reaches like 9,999,999 it goes to 10M. I am trying to broadcast it using
if(score > PlayerPrefs.GetInt(“TheDepth”)) {
PlayerPrefs.SetInt(“TheDepth”, score);
I have it running on a timer and every 1 seconds it adds 1 point, and requesting it from other areas using
GetComponent ().text = PlayerPrefs.GetInt (“TheDepth”) + “”;
It doesn’t save or add the taps to all scripts. if you could help me get some code ,In C#, that allows it to do both I would greatly appreciate it. Thanks -Goof

Please use code tags.
You shouldn’t be permanently reading from and writing to the PlayerPrefs.
How familiar are you with the programming language itself?

As suddoha said load playerprefs, save to some variable and use that variable, when you want to savw progress save variable to prefs.
About 10m it is just about showing it. If larger than 9,999,999 show it as 10m

I figured it out

1 Like