I’m trying to set a timer to my game for 3 hours now i want the timer to wait for 3 seconds why this is not working im new in c# and unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
public class Timer : MonoBehaviour
{
public Text timerText;
private float startTime;
private bool aka = true;
void Start()
{
aka = false;
startTime = Time.time;
}
IEnumerator SpawnWaves()
{
yield return new WaitForSeconds(3f);
while(true)
aka = true;
}
void Update()
{
{
if (aka = true)
{
float t = Time.time - startTime;
string minutes = ((int)t / 60).ToString();
string seconds = (t % 60).ToString("f2");
timerText.text = minutes + ":" + seconds;
}
}
}
}
am I doomed to fail?