- Home /
Question by
GeoffreyFreudenberg · Aug 15, 2018 at 01:13 AM ·
updateplayerprefsupdate functionupdate problem
How to call PlayerPrefs in an Update function without hogging memory?
In my scene I have a single script with a single line of code that checks if a key exists in PlayerPrefs and it's taking 54% of the memory just to do that. What gives?
Comment
Preferably, you should be calling memory-intensive functions only once or otherwise very rarely. Ins$$anonymous$$d, try writing the result to a bool once and only using the bool after that, since you shouldn't be saving PlayerPrefs once per Update.
it's just a percentage. if nothing else would occupy memory this would be 100%. and yes, use playerprefs only at the very start and end of your value changing algorithms. in other words cache it