Problem with enemy health.

I have scripts:
(in Missile)


 void OnCollisionEnter(Collider
collision) 	{ 		if
 (collision.gameObject.name ==
 "ZombieSpawn(Clone)"){ 		EnemyFight
 efight =
 collision.GetComponent<EnemyFight>();
			efight.DecaraseHP(10);


	} 	}

and something in EnemyFight (script)


public int enemyMaxHp = 10;
	public int enemyHp = 10;

and

> public void DecaraseHP(int minusHP) 	{
> 		enemyHp -= minusHP;

	}

What’s mine problem? When i shoot to enemy a last created enemy take damage, not this enemy who are shooted by me. Please help me! :frowning:

I searched on google but nothing works.

you can use below scripts to do what you want.

missile script

public damage int = 10;
void OnCollisionEnter(Collision col) {
    gameObject.GetComponent<enemyScript>().decreaseHealth(damage);
}

enemy script

public health int = 100;

public void decreaseHealth(int damage) {
    health -=damage;
}