How to clear variables from script.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
shirohige
Posts: 2
Joined: Tue Sep 07, 2021 9:34 am

How to clear variables from script.

Post by shirohige »

Code: Select all

DialogueLua.GetVariable()
and

Code: Select all

DialogueLua.SetVariable()
work very well, how can I remove a variable in a similar way?

Best regards.
User avatar
Tony Li
Posts: 21984
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to clear variables from script.

Post by Tony Li »

Hi,

You can set it to null:

Code: Select all

DialogueLua.SetVariable("Your Variable", null);
To reset the entire database, use DialogueManager.ResetDatabase():

Code: Select all

DialogueManager.ResetDatabase();
shirohige
Posts: 2
Joined: Tue Sep 07, 2021 9:34 am

Re: How to clear variables from script.

Post by shirohige »

Thx!
User avatar
Tony Li
Posts: 21984
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to clear variables from script.

Post by Tony Li »

Glad to help!
Post Reply