Trigger not working on Enemy Prefab

Hi, i have a player tagged Head and some enemys which will be instantiated randomly.

My enemy is an animated Sprite. i put a script on it which let him move and play attack animation if it hits the player. But the trigger does not get activated.
My player have box collider with trigger enabled and circle collider without trigger, he is tagged as “Head”.
My enemy has circle collider. I made some tests but its still not triggering using this function
` void OnTriggerEnter2d(Collider2D coll)
{

    if (coll.tag == "Head")
    {
        ani.Play("EnemyAttack1");

    }
}`

Please, wth im doing wrong?

The method is ‘OnTriggerEnter2D’, notice the capital D.

oops i forgot that that the method name is case sensitive, so i wrote OnTriggerEnter2d instead of OnTriggerEnter2D. Problem solved

you need to write :

void OnTriggerEnter2D()
{
print("do");
}

and be fun :smiley: