How to delete playerprefs on build

I want to know how to delete all the playerprefs when i build project… i tried clearing them before building but they still didn’t delete on build

PlayerPrefs.DeleteAll()

This deletes all existing player pref data

By deleting, do you mean have their values reset?
I don’t know how your project is setup/how many scenes, what the scope is, etc. but it sounds like you need a new game screen.


On your build, make the initial scene an intro scene that is basically a UI interface with a button called New Game, then on the button click it does two things: Copy and paste all the different player pref values and set them to 0 or null, like this:

PlayerPrefs.SetInt("Score", 0);
PlayerPrefs.SetString("Name", null)

And then after it load the starting scene immediately after you have all the values reset, so that when you load the new scene it does all the playerprefs.Get after that.