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!