click idle and i use PlayerPrefs

hello guys i
need Little help
i make click idle and i use PlayerPrefs
to save and load but
after start game all cost go to 0
ther is C#

public float cost;

void Start ()

{

OnLoad();

}

public void OnLoad()

{

cost = PlayerPrefs.GetFloat (“cost”);

}

after start game cost go to 0
:confused:

Thank you for understanding

75586-test.png

In order to save your Player Prefs value, you need to first SET it. The PlayerPrefs value “Cost” is not linked to your public float “cost.”

To set a PlayerPrefs value, use PlayerPrefs.SetInt();

For Instance:

PlayerPrefs.SetInt("cost",100);

Please read the documentation and if you have any questions, read this forum post.

I found a tip
make UI button to save and load