it’s probably easy but i can’t find an answer googling it, basicly what i want is when an enemy is dead remove him from the list.
here is the code, at least how i think it goes somewhat similar, but this doesn’t work
foreach(EnemyStats eStats in targets.Select(T => T.GetComponent<EnemyStats>()))
{
if(eStats.Health <= 0)
targets.Remove(this.gameObject);
}