0 votes

Greets!

Would anyone tell me how to get back to my last position in a tilemap after having entered and exited a new scene?

Cheers!

in Engine by (325 points)

Can you elaborate?

That is, my player travel on a' tilemap'(multiples hex sprites aligned together), and enter zones of first person view with full images as the setting of a point and click game.

Just wanna know how to get back to its previous position on the 'tilemap' when he entered the zone? Or how to assign exits on the 'tilemap'?

1 Answer

0 votes

Not Tilemap specific, but..

You could store the player's previous position in global scripts (autoloaded script).
If you enter the scene again, you could check the position stored in the global scope and apply it (in the _ready() function)
(At least that's what i do when i re-enter my tilemap from another scene and it works..)

For global scripts please have a look at:
https://docs.godotengine.org/en/3.1/getting_started/step_by_step/singletons_autoload.html

by (40 points)

Yes, seems the best to keep datas, though the docs about it is a bit short. Could you be a bit more specific about your scripts?

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 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 webmaster@godotengine.org with your username.