Page 1 of 1

Variables Not Reset Properly

Posted: Wed Jan 05, 2022 2:55 am
by HunterTom
Hi,

I am using

Code: Select all

SaveSystem.RestartGame("PrototypeEntry");
to restart the game.

However, the variables in the dialogue database are not being reset properly. I still need to exit the game completely and open the build.exe to reset the variables.

Am I doing anything wrong here?

Thank you very much!

Re: Variables Not Reset Properly

Posted: Wed Jan 05, 2022 8:42 am
by Tony Li
Hi,

Is a Dialogue System Saver component present in any scenes when you run SaveSystem.RestartGame()? It's typically on the Save System GameObject or the Dialogue Manager GameObject. The Dialogue System Saver responds to SaveSystem.RestartGame() by clearing the Dialogue System's variables.

Make sure you've assigned a unique Key such as "ds" or "dialoguesystem" to the Dialogue System Saver.