Unity Player Prefs Not Updating After Building

22 views Asked by At

I am using a singleton that runs across multiple scenes (Dont Destroy on Load) that has access to methods and variables used to save & load values using player prefs. Everything works out well except for the currentAmount which is an int variable.

After buidling for mobile, the current amount is fixed at 350 i don't know why.

As from unity editor, everything works well for the current amount.

I tried to debug in the unity editor and see if there is something wrong but everything works out fine.

Furthuremore, the unity editor displays the currentAmount as updated value (Keeps changing depending on certain events), which is what i expect.

The moment i build and test in a mobile device, the value is stuck/fixed at 350.

I tried out on different mobile devices still the same issue.

1

There are 1 answers

2
Koray Üstündağ On

I can't say anything clearly without seeing the code. But my guess is that the source of your problem is the Unity Runtime. Could you try downgrading to the previous version and compiling again? If the problem persists despite the downgrade, you can report it as a Runtime issue.