So, I have this script:
using UnityEngine;
using UnityEngine.UI;
public class MenuSumiu : MonoBehaviour {
public float timeLeft = 10.0f;
public GameObject tutorial;
Text countdowntext;
void Update()
{
timeLeft -= Time.deltaTime;
countdowntext.text = "This will close in: ";
if (timeLeft < 0)
{
}
}
}
And I get spammed with
NullReferenceException: Object reference not set to an instance of an object
MenuSumiu.Update () (at Assets/MenuSumiu.cs:12)
Can someone help me?