OnCollisionEnter2 problem.

void OnCollisionEnter2D (Collision2D col)
{
Debug.Log (“hi”);
}

I have no idea why this code is not working. Both of my objects have collider2D.

Any ideas? Thanks for help.

Make sure you have a ridigidbody2d attached to one of the objects.