I have a parent object with a child object in front of it. When the child object collides with an object it is detected in OnCollisionEnter2D. How do I determine whether it was the child or the parent that collided and is it possible for the collision detection to only fire when the parent is in contact with the object?
On the CollisionEnter2D method you can dig down in to the code and get the name of the GameObject that hit it. Remember when referring to self, use a small g for gameObject. So the col that collided to trigger this method. Then get a hold of the gameObject. The get the transform and finally the name. If your parent and child have different names then it should be no problem to identify what object collided with the it.