I need the text mesh to appear and disappear in scene right at ten seconds or less . I got most of the code done . I only got one error :
(7,12): error CS0118: oik.text' is a
field’ but a `type’ was expected
Here is my code :
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class oik : MonoBehaviour {
private text text;
void ShowMessage(string message, float timeToShow = 10)
{
StartCoroutine(ShowMessageCoroutine(message, timeToShow));
}
IEnumerator ShowMessageCoroutine(string message, float timeToShow = 10)
{
while (timeShown < timeToShow)
{
timeShown += Time.deltaTime;
yield return null;
}
text.text = " The Reqiure Score is 1700" ;
}
}