Variables Not Reset Properly

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
HunterTom
Posts: 18
Joined: Fri Dec 24, 2021 4:58 pm

Variables Not Reset Properly

Post 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!
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variables Not Reset Properly

Post 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.
Post Reply