Hi,
I was wondering if there is a way to access a variable inside Dialogue->Variables and be able to change its value via a script inside any game object.
Thanks,
Javier.
Dialogue->Variables.. Change it from a script.
Re: Dialogue->Variables.. Change it from a script.
Hi Javier,
Yes, use DialogueLua.GetVariable() and SetVariable():
Yes, use DialogueLua.GetVariable() and SetVariable():
Code: Select all
using PixelCrushers.DialogueSystem;
...
int score = DialogueLua.GetVariable("Score").AsInt;
score = score + 50;
DialogueLua.SetVariable("Score", score);
Re: Dialogue->Variables.. Change it from a script.
Hi,
Thanks for the help! It worked!
Thanks for the help! It worked!
Re: Dialogue->Variables.. Change it from a script.
Great! Glad to help.