Runtime Save Deletion

Deleting saves with code.

Deleting saved data can be a dangerous task, as it results in the player losing their progress. Make sure saves are being deleted only when necessary (usually only when the player manually deletes them).

Deleting Specific Data

As long as you have a reference to a SaveFile, you can freely delete any data.

// Where "DataID" is the ID (or key) of the saved data you'd like to delete
saveFile.DeleteData("DataID");

Deleting a File

Use the method below to completely remove a save file from the user's system.

saveFile.DeleteFile();

Empty File

Alternatively, you have the option of completely removing all data while keeping the file in the user's system.

saveFile.EmptyFile();

Last updated