- Home /
Question by
mouz13 · Jun 06, 2021 at 03:29 PM ·
destroyscripting beginneranimator controllerif-statements
Make Animator bool false when object is destroyed
Hello guys! I have a problem and i need your help. I have this script:
void OnCollisionEnter(Collision col) { if (col.gameObject.name == "Erotisi") { Destroy(col.gameObject); Destroy(Jason); Destroy(gameObject); Hercules.gameObject.GetComponent().SetBool("Animate", true); HoloUI.gameObject.GetComponent().Play(); Hydra.gameObject.GetComponent().SetBool("Animate", true); Hydra.gameObject.GetComponent().PlayDelayed(3); Destroy(Hydra, 4); } }
It works fine but i want when Hydra is destroyed " Hercules.gameObject.GetComponent().SetBool("Animate", false);". How can i test if Hydra is destroyed? Or is there any other way to make it?
Comment