How to collect more than one object per frame

Hi Everyone
I have a issue which is about collect objects per frame.
I’m trying to create attacking system for a 2d game.
I give a collider to player and set it as trigger and rigibody2d.
and enemy give a collider.

my script like here

public List EnemyList;

void OnTriggerEnter(Collider other) {
EnemyList.Add(other.gameObject);
}

My issue is when enemy stand stick I can get only a object.
Are anyone would like to help me?

Thank you for reading.

I see no reason why it would not work. Are you sure you only have one object in your list?

1 Like

Oh my bad.Before this I test by playmaker it does not work but in script everything ok thank you for reply.