- Home /
How to save and load the state of dialogue when changing scenes
I have a dialogue system set up which stores different nodes and dialogue within a JSON file, I also have it set so that the dialogue manager recognizes if a node has already been visited before. The only problem is, once I load into a new scene, the entire dialogue system essentially reloads itself and if I revisit the scene where I originally initiated dialogue it runs as though it's running for the first time again. I've tried using don't destroy on load on my dialogue manager but doing so only destroys functionality within the dialogue system and throws errors for implementation not being set.
Answer by chemariz · Mar 11, 2019 at 11:50 PM
This seems to be quite an old topic: how to share the game state between scenes. You should have a singleton class where you store all the information of the current game. Being singleton (and not destroyable on load) you should be able to store and retrieve any value from any scene. There you could store some variable pointing to the current dialog node.
Your answer
![](https://koobas.hobune.stream/wayback/20220612193415im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can I create an NPC Dialogue with UI Text? 1 Answer
Cant Get Dialogue Trigger Working 0 Answers
Saving JSON didnt work 1 Answer
how to save and load component values from unity editor? 1 Answer