Hello friends, I writed a basic script but I can’t save my money(like score). I’m not want best score or something. What is wrong?
Thats the basic money script;
static var moneys = 0;
function Update()
{
PlayerPrefs.GetInt("dollarf");
PlayerPrefs.SetInt("dollarf",moneys);
}
And thats the Int sender to text script;
var dollarText : UnityEngine.UI.Text;
function Update () {
dollarText.text = "Money " + PlayerPrefs.GetInt("dollarf");
}
When I adding money with this script;
function Update () {
if(Input.GetKey(KeyCode.L)){
dollarsystem.moneys +=10;
}
}
I only see when I back to menu, It’s saved. But when I stop playing and restarting the game It’s going… What’s wrong?