+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?

asked Aug 26, 2017 in Engine by DanielS559 (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.

answered Aug 26, 2017 by Zylann (26,131 points)
selected Aug 26, 2017 by DanielS559

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 How to use this Q&A? before posting your first questions.