public void hitProjectile(Collider2D other) { Equip e = other.gameObject.GetComponent <Equip>(); if (e) { if (e.CompareTag("Projectile")) { healthPoints -= e.damage; if (other.gameObject.GetComponent <Projectile>().dropped == false) { other.gameObject.GetComponent <Projectile>().dropped = true; other.gameObject.GetComponent <Projectile>().spawn_drops(); } Destroy(other.gameObject); onDamage(); } else if (e.CompareTag("Slash")) { healthPoints -= e.damage; onDamage(); } applyStatus(e); } }