Quest Tracker is not Updating
Posted: Mon Aug 22, 2022 6:14 am
Hello, it my first time working with Dialogue System for Unity. I am trying to make a simple quest where you pick up some plants and deliver it.
The problem is that the Quest Tracker in screen isn't updating the number of plants. In the journal it shows correctly, but I need to untrack and track again the quest to show the plants picket up in the Quest Tracker.
This is the code I use to pick up plants
And this is where the Quest Log is located (Is the only thing I added quest related)
I spend a long time looking but the only thing I find to update the tracker whas this line of code that didn't work for me
DialogueManager.instance.SendMessage("UpdateTracker");
The problem is that the Quest Tracker in screen isn't updating the number of plants. In the journal it shows correctly, but I need to untrack and track again the quest to show the plants picket up in the Quest Tracker.
This is the code I use to pick up plants
Code: Select all
public class PlantPickUp : MonoBehaviour
{
bool inside;
private void Update()
{
if (inside && Input.GetKeyDown(KeyCode.E))
{
DialogueLua.SetVariable("DessertPlants", DialogueLua.GetVariable("DessertPlants").asInt +1);
//DialogueManager.instance.SendMessage("UpdateTracker");
print(DialogueLua.GetVariable("DessertPlants").AsInt);
}
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
inside = true;
}
private void OnTriggerExit(Collider other)
{
if (other.gameObject.CompareTag("Player"))
inside = false;
}
}
I spend a long time looking but the only thing I find to update the tracker whas this line of code that didn't work for me
DialogueManager.instance.SendMessage("UpdateTracker");