Two EdgeCollider2D components not colliding

I’ve got three game objects: My player, a child game object of the player called “feet”, and a platform. My player (a 2D sprite) has a Box Collider 2D and a Rigidbody 2D, his feet (an empty game object) have an Edge Collider 2D and a Rigidbody 2D, and the platform (a 2D sprite) has an Edge Collider 2D on its top edge.

I have this script set on my platform:

void OnCollisionEnter2D(Collision2D collision)
{
	Debug.Log(collision.collider.gameObject.name);
	_player.rigidbody2D.AddForce(Vector3.up * _force, ForceMode2D.Impulse);
}

Now, when the player collider with the top edge of the platform, he bounces up off of it (think Doodle Jump). However, when I disable collision between the player and the platform (denoted by custom “Player” and “Platforms” layers), and only allow collisions between platforms and the “Feet” layer – which is applied to the feet game object – no collision takes place.

I thought maybe it was an issue with nested layers (since my player game object has a layer of “Player,” and its feet child object has a layer of “Feet”) but when I moved the edge collider onto my player and disabled my feet game object, I still didn’t get a collision.

I’ve also tried this converting the edge colliders into triggers (and have added an OnTriggerEnter2D handler on my player to test the functionality) to no avail.

Any ideas?

I would guess that it’s nearly impossible for parallel edge colliders to collide using Discrete Collision Detection - at any given FixedUpdate, the colliders have either not yet collided, or they’re already past each other.

Try setting the Collision Detection in your Rigidbody2D to Continuous.