timer not starting when i want!

I have the following code attached to a gameObject. I have a object that flies through hoops as a racing style game. I want the timer to start when the player goes through the first hoop (tagged StartHoop). However, the timer starts as soon as the level loads. I’m not sure why.

var startTime : float;
var textTime : float;

function onTriggerEnter ()
{
if (gameObject.tag =="StartHoop")
{
startTime = Time.time;
yield WaitForSeconds(destroyTime);
Destroy(gameObject);
}
}

function OnGUI
{
var guiTime = Time.time-startTime;
var minutes : int = guiTime/60;
var seconds : int = guiTime% 60;
var fraction : int = (guiTime * 100) % 100;

textTime = String.Format("{0:00} : {1:00} : {2:00}", minutes, seconds, fraction);
GetComponent(GUIText).text = textTime;
}

Thanks in advance :slight_smile:

[Question solved in comments above, please use the Forums for discussions. Adding this answer to remove it from the Unanswered view, Unity Support.]