Easier to read timer

void UpdateTimer()

{

    timerValue -= Time.deltaTime;

    if(timerValue <= 0)

    {

        if(isAnswerQuestion)

        {

            isAnswerQuestion = false;

            timerValue = timeToShowCorrectAnswer;

        }

        else

        {

            isAnswerQuestion = true;

            timerValue = timeToCompleteQuestion;

        }

       

    }

    Debug.Log(timerValue);

}

This works the same way without asking if timer value is less than or equal to 0 twice.

1 Like

Privacy & Terms