I simply want a “You win” text canvas in worldview to popup in when user collides with trigger. If I set it to active false, when it is reactivated, there is no text. The trigger is working. I don’t want to disable any layers. Any other thoughts?
if you just want a simple You win text to appear you could make a public Text variable and Set to be Equal to youre You win Text then Set text variable to true
somethign like this
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class test : MonoBehaviour {
public Text WinText;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if (Condition)
{
WinText.enabled = true;
}
}
}
remember to add using UnityEngine.UI; or else you cant use the a Text hope this solves it
Try using Canvas.enabled. This is a simple boolean value, that basically activates and deactivates the canvas component as you wish.