- Home /
How to clear all the players that have played my games playerprefs?
So I'm updating my game, but will need all my players to have a new save. How do I clear all of their data when they play my game, but avoid clearing it after that?
PS. WebGL build
Answer by senjupraveen · Mar 21, 2017 at 08:16 AM
PlayerPrefs.DeleteAll(); use this it remove all the data stored in playerprefs
Answer by herDev · Mar 21, 2017 at 07:07 AM
In my opinion you shouldn't try and clear the data in this case, because you would need to flag that it's a first launch post-update and ideally keep track of that with back-end data or it will get messy.
Instead, why not assign the player save data to new key names? At the same time, you can manually delete the old player preference keys if they exist. That way, post update all your players will have fresh save game data and you can clean up the old keys.
Hope that helps!
Your answer
Follow this Question
Related Questions
webgl saving. 1 Answer
how to properly save an int value ? 2 Answers
How can I save a character during runtime using script? 3 Answers