Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
One of your colliders doesn't have a Rigidbody2D attached to it, as it says in the documentation, in order to get collisions works, one of the two object must have a rigidbody component
You are checking "isTrigger" and expecting OnCollision response, if your collider set to trigger then you should use "OnTriggerEnter2D" instead
Everything works but your console doesn't shot any messages, make sure the "bubble" icon is pressed in the console window, to be sure just print something in the Start() method and see if it shows up.