public void DealDamage(float damage) { currentHealth -= damage; if (currentHealth <= 0 && !dead) { dead = true; sc.AddPointValue(score); // Change this to do the animation for each object. if (disableScriptObj != null) { disableScriptObj.SetActive(true); } else { this.gameObject.transform.parent.gameObject.SetActive(false); } } }