Hi im trying to get my script to wait 5 seconds before makes all 4 variables true if the health is set to 0… this is what i’ve written… and it doesn’t work
if (Health == 0)
{
Instantiate (deathParticles, gameObject.transform.position, gameObject.transform.rotation);
Destroy (gameObject);
StartCoroutine (Waiting());
}
IEnumerator Waiting()
{
yield return new WaitForSeconds(5);
deathScreen.SetActive(true);
resetButton.SetActive(true);
menuButton.SetActive(true);
redTrans.SetActive(true);
}