0 votes

Hi,
For a 3D game, I need to save the player's coordenates using a ConfigFile and in the next game, load it.
I used the following GDScript code:

config.set_value("values", "player_position", $Player.position)

For saving it and the following for loading it:

$Player.position = config.get_value("values", "player_position")

I think the game stores this data in the config file as a Vector3(), but it doesn't work.
The error message is the following:
Invalid call. Nonexistent function 'loadencryptedpass' in base 'Nil'.
Someone can tell me how I can fix this error?
Thanks in advanced.

Godot version 3.2.3
in Engine by (353 points)

1 Answer

+3 votes
Best answer

For the position in 3d I think position no exist. Use: global_transform.origin

config.set_value("values", "player_position", $Player.global_transform.origin)
by (2,260 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.