Answer the question
In order to leave comments, you need to log in
Timer problem. When you click on the button in the UI, the timer when it becomes > 15 should turn off the object. What to do?
public GameObject RELOAD;
public float timer = 0f;
public float cooldown = 15f;
public void Start()
{
}
public void Update()
{
timer += Time.deltaTime;
}
public void OFF()
{
RELOAD.SetActive(true);
timer=0f;
if(timer > cooldown)
{
RELOAD.SetActive(false);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question