Hi guys i would like to save my vars so that if i have for example 200xp and I stop the game and restart it, i still have 200 xp someoneknows a way to save those variables?
You can use PlayerPrefs: if it’s an integer, save the value with PlayerPrefs.SetInt, and load it at Start with PlayerPrefs.GetInt (you also have functions to save/read Float and String). An example: suppose you want to save the float value health:
// load the health at Start (assumes 100 if PlayerHealth not found):
health = PlayerPrefs.GetFloat("PlayerHealth", 100.0);
// save the health whenever it's changed:
PlayerPrefs.SetFloat("PlayerHealth", health);