public void ReactToHit() { WanderingAI wanderingai = GetComponent <WanderingAI>(); if (wanderingai != null) { wanderingai.setDie(); } StartCoroutine(Die()); }