public void InitSlider() { //Set max value of slider to next lvl xp xpSlider.maxValue = GameUtils.CalculateNextLevelXP(GameManager.SP.playerData.playerXP); Debug.Log("nxt LVL needed: " + GameUtils.CalculateNextLevelXP(GameManager.SP.playerData.playerXP)); xpSlider.minValue = GameUtils.GetXpForLevel(GameUtils.CalculateLevel(GameManager.SP.playerData.playerXP)); //Set value of lsider to right xp xpSlider.value = GameManager.SP.playerData.playerXP; goalValue = xpSlider.value; }