Hi, I was wondering if there is a quick fix to my problem. I have 8 buttons which activate a different timer for each. But when deactivate the timer and then activate it again it doesn’t reset. I have tried reseting it through the button to access the gameobject script but with no luck. any help would be appreciated.
var progress : float = 0;
var pos : Vector2 = new Vector2(20,40);
var size : Vector2 = new Vector2(60,20);
var progressBarEmpty : Texture2D;
var progressBarFull : Texture2D;
function OnGUI()
{
GUI.DrawTexture(Rect(pos.x, pos.y, size.x, size.y), progressBarEmpty);
GUI.DrawTexture(Rect(pos.x, pos.y, size.x * Mathf.Clamp01(progress), size.y), progressBarFull);
}
function Update()
{
progress = Time.time * 0.01;
}