Hi i have this script…
private var startTime;
var textTime : GUIText;
function OnTriggerEnter (other : Collider){
startTime = Time.time;
}
function Update() {
line 12 error — var guiTime = Time.time - startTime;
var minutes : int = guiTime / 60;
var seconds : int = guiTime % 60;
var fraction : int = (guiTime * 100) % 100;
textTime.text = String.Format (“{0:00}:{1:00}:{2:00}”, minutes, seconds, fraction);
}
the script work but i have a error in line 12
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs)
TimerScriptStart.Update () (at Assets\TimerScriptStart.js:12)
i dont understand really the error
my question is i want stop the timer when i enter in the other trigger and display on screen the time a with a option to save this time in the high score…
thank you for your help…