Hi everyone!
I want add “Warmup” to my game like Counter strike Warmup.
I want that after 30 sec game start and restart player to original position and there is not timer anymore in the game.
How can I Do? I use this line too but not working:
if (cuurentTime == 0)
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
but is not working. I use this cod:
public class TimerCountDown : MonoBehaviour
{
float cuurentTime = 0f;
float startingTime = 30f;
[SerializeField] Text CountDownText;
void Start()
{
cuurentTime = startingTime;
}
void Update()
{
cuurentTime -= 1 * Time.deltaTime;
CountDownText.text = cuurentTime.ToString("0");
if (cuurentTime <= 0)
{
cuurentTime = 0;
}
}
}