So I’m working on a project that replaces the bestDistance value with the currentDistance value when bestDistance > currentDistance (meaning new high score). I then save it using PlayerPrefs.SetFloat (“Best Distance”, bestDistance). However, this is not working. It does not save ** any** PlayerPrefs period, even though the function itself works fine. Has something changed with PlayerPrefs in Unity 5.5?

Here is my code:

```
var bestDistanceText : UI.Text;
var currentDistanceText : UI.Text;
var bestDistance : float;
var currentDistance : float;
function Awake ()
{
bestDistance = PlayerPrefs.GetFloat ("Best Distance");
currentDistance = 0.0;
bestDistanceText.text = bestDistance.ToString ();
}
function Start () // Add ".0 m" if number does not have anything after decimal (1 to 1.0, 2 to 2.0, 10 to 10.0, etc.)
{
if (System.Math.Round (Mathf.Abs (bestDistance), 1) == bestDistance, 0))
{
bestDistanceText.text = bestDistance + ".0 m";
}
else
{
bestDistanceText.text = bestDistance + " m";
}
}
function Update ()
{
currentDistance = System.Math.Round (Mathf.Abs (Time.timeSinceLevelLoad / 2), 1);
if (System.Math.Round (Mathf.Abs (currentDistance), 1) == System.Math.Round (currentDistance, 0)) // Add ".0 m" if number does not have anything after decimal (1 to 1.0, 2 to 2.0, 10 to 10.0, etc.)
{
currentDistanceText.text = currentDistance + ".0 m";
}
else
{
currentDistanceText.text = currentDistance + " m";
}
if (currentDistance > bestDistance)
{
NewBestDistance ();
}
}
function NewBestDistance ()
{
bestDistance = currentDistance;
bestDistanceText.text = currentDistanceText.text;
PlayerPrefs.SetFloat ("Best Distance", bestDistance);
}
```

I have tested this by printing "PlayerPrefs.GetFloat (“Best Distance)” every frame and it always returns 0, even after having broken the high score. The bestDistanceText value changes as it should, but it does not update the PlayerPrefs at all.

Any help would be greatly appreciated!