hello I cant figure why it wont count down it keeps debugging it saying timer at 70
i call this script from a different script and tell it to run the function reset
and set howMany to a certain int same with timeAmount.
#pragma strict
var howMany : int;
var theMain : GameObject;
var timeAmount : int;
var myTimer :int = 0;
function Update () {
if(myTimer >= 0){
myTimer -= Time.deltaTime;
Debug.Log("timer "+ myTimer);
}
if(myTimer < 0){
Debug.Log("timer finish");
// Result ();
if (howMany > 0)
theMain.GetComponent(furnace).Result();
howMany -= 1;
Reset ();
}
}
function Reset () {
Debug.Log("Reset");
myTimer = timeAmount;
}