Hello, I am watching a tutorial for making a game in Unity and I’m having an issue with one of my scripts. The tutorial I’m watching uses the old GUI system instead of the new UI system, so I’m having a hard time replicating what the tutorial is looking for in the UI system. Here’s the code that the tutorial uses, w/ the GUI system:
using System.Collections;
using UnityEngine;
public class Finish : MonoBehaviour {
public GUIText winText;
// Use this for initialization
void Awake ()
{
winText.enabled = false;
}
void OnTriggerEnter (Collider other)
{
if (other.gameObject.tag == "Player")
{
winText.enabled = true;
}
}
}
How do I replicate the “public GUIText winText” with the UI system? Also, do I need to put “using UnityEngine.UI” at the top of this script? Thank you in advance!