I wanted my timer coroutine to be called per second, I already searched the web for solutions but I already know most of it and it still does not work. Here is my code.
IEnumerator TimerSeconds()
{
while (gameManager.gameState == GameManager.GameState.Level_1 && gameManager.startTimer)
{
yield return new WaitForSeconds(1);
if(timerSec > 0)
{
clock.fillAmount -= 0.0142857142857143f;
timerSec -= 1;
} else
{
clock.fillAmount = 0f;
timerSec = 0;
}
secText.text = timerSec.ToString();
}
}
is there something wrong? I’m literally losing my mind here.