Page 1 of 1

Set value for a Variable of a Dialogue before Start it.

Posted: Tue Jul 25, 2023 6:08 am
by hoangcuongzk1
I have a prefab UI, it contains a Dialogue. This Dialogue has a "Coin" Variable. And a condition on the converstation need to use it.
My Player kills enemy and collect coin. I am using 'DialogueTriggerSystem' to change 'Coin' value. But when player meet NPC and open the Dialogue. Even player kills 100 enemies, the 'Coin' Variable equals 0.
How i change value of a Variable before Dialogue contains it not yet open ?

(My player does not meet NPC first, after kill many enemies, he will meet NPC, at the moment the dialogue start)

Re: Set value for a Variable of a Dialogue before Start it.

Posted: Tue Jul 25, 2023 9:56 am
by Tony Li
Hi,

Let's first make sure your Coin variable is incrementing. Use the Dialogue Editor's Watches tab or the Variable Viewer window.

Here's an example scene:

DS_CoinExample_2023-07-25.unitypackage