// creates the method that is called in the shoot class public void ReactToHit() { // checks if target has wandering ai script and if so sets its status to not alive WanderingAI behavoir = GetComponent <WanderingAI>(); if (behavoir != null) { behavoir.setAlive(false); blood.Play(); behavoir.turnOffNavMesh(); } StartCoroutine(Die()); }