+1 vote

I am working on an rpg game and I want the player to affect a scene by taking objects or other things then leave the scene and come back and find the scene as he/she left it.

How do I save the state of a scene so that the player can come back to it?

in Engine by (16 points)

1 Answer

+3 votes
Best answer

You can either:

1) Save the state of the scene you left, in a global node for example, that you would save in a file to be sure it gets remembered when you restart the game (which you will have to do anyways if you want that to happen), and restore it when it gets loaded again, with some scrips reading the data you saved and setting the variables and states and visible/invisible stuf that you changed.

2) Don't destroy the scene you left, just hide it / make it inactive somehow, so when you come back it actually is the way you left it. However if you want this to persist between two sessions, you do still need to save those states in a file (which is another matter already covered by other questions on this website ;) )

You can mix the two approaches, details of how you do it depends on your game.

by (29,034 points)
selected by

Thank you that helped a lot.

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.