2D collision detection not properly working

Can someone please explain to me why this code:

void OnCollisionEnter2D(Collision2D collision){
if(collision.gameObject.name.equals(“deathBox”){
Debug.Log(collision.gameObject.name);
}
}

is printing out aliveBox. aliveBox is another game object that has a close collider to deathBox, but deathBox should still be getting hit first.
Thanks!

Hello! Can you take a screenshot of the hierarchy? if(collision.gameObject.name.Equals(“deathBox”)) {Debug.Log(collision.gameObject.name);} cannot print out “aliveBox”. Maybe a different function is triggered…