Question by
Hurrinade · Nov 18, 2018 at 03:42 PM ·
textplayerprefsscenes
PlayerPrefs working only in editor but not in build !?!
public class Manager : MonoBehaviour {
public Text Timer;
public Text BestScore;
public float Score;
void Start () {
BestScore.text = PlayerPrefs.GetFloat("HighScore", 0).ToString();
}
void Update () {
Score = Time.timeSinceLevelLoad;
Timer.text = Score.ToString("#.00");
if(Score > PlayerPrefs.GetFloat("HighScore", 0))
{
PlayerPrefs.SetFloat("HighScore", Score);
BestScore.text = Score.ToString();
}
}
}
The timer works fine in editor and game build but "PlayerPrefs" wont work why? It all works in editor but in build it wont show the high score stored with PlayerPrefs.
Note: I am calling UI text element that stores high score from another sceene maybe that has to do something with the problem..
Thanks for help in advance!
Comment
Your answer
Follow this Question
Related Questions
Saving the State of Text in an Array 0 Answers
saving a text into a player pref 0 Answers
PlayerPrefs and Text not working but no errors are given. 1 Answer
Highscore not working 0 Answers