How to Delete a Save Game??

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ismaelgame7
:warning: Old Version Published before Godot 3 was released.

Hello friends,

How do I delete a save by code???

if savegame.file_exists("user://savegame.save"):
>>  #Delete saved file.
pass

Can someone help me?

:bust_in_silhouette: Reply From: supaiku

http://docs.godotengine.org/en/stable/classes/class_directory.html?highlight=delete#class-directory-remove

var dir = Directory.new()
dir.remove("user://savegame.save")

Something like this should do it.

Thank you :slight_smile:

ismaelgame7 | 2016-12-28 18:18