Im just trying to make something very simple which counts up to 3, in this case, and when it reaches 3, does something. But, if the boolean is turned off during that time, it resets back to 0.
Here is what I have so far
var Last : float = 0.0;
var IsTrue : boolean = true;
function Update ()
{
if (IsTrue == true) {
Last = Time.time;
}
if (IsTrue == false) {
Last = 0;
}
if ( Last > 3.0 ) {
Debug.Log ("Something");
}
}
but of course Time.time is read only.