Here is my Code
#pragma strict
public var timerText:GUIText;
private var allowedTime:int = 99;
private var currentTime:int;
function Start ()
{
currentTime = allowedTime;
UpdateTimerText();
TimerTick();
}
function Update ()
{
}
function UpdateTimerText()
{
//update the GUI Text on screen
timerText.text = “Time:” + currentTime;
}
function TimerTick()
{
while(currentTime > 0)
{
//waits for 1 sec before doing anything
yield WaitForSeconds(1);
//update the time
currentTime–;
//calls timer update
UpdateTimerText();
}
//timer is, do something (This is where you put what happens if it gets to 0
}
Here is my Error: UnassignedReferenceException: The variable timerText of ‘GUI_Timer’ has not been assigned.
You probably need to assign the timerText variable of the GUI_Timer script in the inspector.
GUI_Timer.UpdateTimerText () (at Assets/Scripts/GUI_Timer.js:23)
GUI_Timer.Start () (at Assets/Scripts/GUI_Timer.js:10)
it says it at this section: timerText.text = “Time:” + currentTime;
What does this mean???