- Home /
PlayerPrefs in android
hi all, i'm doing an app for android, and i use "playerprefs.setfloat" and "getfloat". Why this function work in pc but not onto my smartphone?
Answer by utAlpha09 · Nov 24, 2013 at 07:57 PM
If you are using a float or int make sure that the number is properly defined. For example 1.0120 is a float. If you have Var anumber : int; Var afloat : float;
function Start (){
afloat = 1.01;
PlayerPrefs.SetInt(afloat);
}
It will not save because you are trying to save a float as a integer or vice versa.
I had this issue when i was doing player preferences
By the way, never use PlayerPrefs in Update(), because it WILL cause stutter on mobile platforms ;)
Your answer
Follow this Question
Related Questions
Does Android delete PlayerPrefs when Updating the App? 2 Answers
PlayerPrefs not Saving Properly on Android (Works in Editor) - OnApplicationPause/Quit 1 Answer
Resize GUI Button (linked to website) ?? 1 Answer
UI Button when build to android function does not work 0 Answers
How can I make the free and the full versions of my android game shares the same PlayerPrefs ? 0 Answers