As you can see in the image, The number is printing but the value is never decreasing only staying at 4.986…
Simply, I am trying to make a countdown I’ve looked through many other unity answer posts and answers all showing the same/similar format to what I’m doing, I feel I’m simply missing something but can someone help my issue, Thanks (-:
private void Update()
{
if (Input.GetMouseButtonDown(0) && startText.gameObject.active)
{
startText.gameObject.SetActive(false);
startTimer = true;
}
float countTime = 5f;
float timeTarget = 0f;
countTime -= Time.unscaledDeltaTime;
if (countTime > timeTarget && startTimer)
{
Debug.Log(Time.unscaledDeltaTime);
counterText.gameObject.SetActive(true);
counterText.text = countTime.ToString("f1");
}
else if (countTime <= 0f)
{
Time.timeScale = 1.0f;
PlayerMove.canJump = true;
ObjectMove.gameActive = true;
}
}
Oh and, The time.timescale is set to “0.0f” in the start void as I don’t want anything to start moving until the user wants them to hence why I’m using time.unscaledDeltaTime :-3