BoxCollider2D error

So I’ve ran into a problem today with how my character attacks. Basically when you attack the box collider turns on for a certain amount of time. The problem is that the enemy gets destroyed even if it doesn’t hit the collider. For some reason it can collide when it’s above the box collider.
Shown in this gif:
alt text

The bat can be seen floating above the box collider I have selected yet it still destroys. The bat has a small box collider attached which doesn’t come in contact with the selected box collider at all.

The enemy can also somehow hit the player when the colliders aren’t touching.

alt text

It’s very hard to answer without seeing the code, and I don’t know what you are writing this in, but it is definitely hitting something. Try using Debug.Log to find out what.

Debug.log(col.name);

Where I wrote “col”, put whatever variable you are using for the collision. Then, watch. The debug bar will tell you the name of the object it’s hitting.