All enemies has the same tag “Enemy”. When I try to destroy one of them, the another is destroyed.
Target Script: `public void TakeDamage(float amount)
{
health -= amount;
if (health <= 0)
{
Die();
}
}
private void Die()
{
Destroy(gameObject);
}
Bullet Script:
if (collision.gameObject.tag == “Enemy”)
{
Target target = GameObject.FindWithTag(“Enemy”).GetComponent();
target.TakeDamage(10);
Destroy(this.gameObject);
}`