Changing Variable not Updating
Posted: Wed Nov 13, 2019 9:41 pm
Hello,
I have a variable named that is accessed to display its current value.
This is the DayText that accesses it:
It displays the initial value of the variable but it isn't updating when the value changes.
Too change the value I have in the Script portion of the nodes written or any other integer but it doesn't update. I've debugged the value on its own to make sure it wasn't the updating the text part that was failing, and it was doing the same only display initial value thing.
I have a variable named
Code: Select all
currentDay
This is the DayText that accesses it:
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using PixelCrushers.DialogueSystem;
public class DayText : MonoBehaviour] {
public Text days;
public string updatedText;
// Update is called once per frame
void Update() {
updatedText = DialogueLua.GetVariable("currentDay").asString;
days.text = updatedText;
}
}
Too change the value I have in the Script portion of the nodes written
Code: Select all
currentDay = 2;