Variable name not updated in dialogue
Posted: Mon Oct 26, 2020 10:33 pm
I tried to use DialogueLua.GetVariable to change my variable, but it doesn't change the value in "Dialogue System -> Variable", even though it seems to work by looking at the console output:
Below is my code and console output:
Debug.Log(DialogueLua.GetVariable("PlayerName").asString);
//console output: Name
DialogueLua.SetVariable("PlayerName", "123");
Debug.Log(DialogueLua.GetVariable("PlayerName").asString);
//console output: 123
However, after running the code above, in Dialogue System "PlayerName" remains "Name". In addition, the next a few lines which use [var=PlayerName] all give me "Name" instead of "123". Am I missing something?
Thank you!
Below is my code and console output:
Debug.Log(DialogueLua.GetVariable("PlayerName").asString);
//console output: Name
DialogueLua.SetVariable("PlayerName", "123");
Debug.Log(DialogueLua.GetVariable("PlayerName").asString);
//console output: 123
However, after running the code above, in Dialogue System "PlayerName" remains "Name". In addition, the next a few lines which use [var=PlayerName] all give me "Name" instead of "123". Am I missing something?
Thank you!