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");