i'm trying to save a 3d player's location by making him touch a save point within a game and then load it again from where it was .
but i don't know how to find the player's coordinates ( x ,y ,z ) to save it .
i watched in youtube and i tried with this code :
i think the error in position
to save :
var game_data = { }
var x = Position3D
func ready():
loaddata()
func savedata():
var file = File.new()
file.open(savefile, File.WRITE)
file.storevar(game_data)
file.close()
to load :
loaddata():
var file = File.new()
if not file.fileexists(savefile):
gamedata = {
x = Position3D
}
_save_data()
file.open(save_file, file.READ)
game_data = file.get_var()
file.close()
if he touch the save point , it will turn it into a scene " save a game "
there are two buttons yes and no
what i do in the yes button?
please help