Ragdoll Collision

I am trying to detect when a ragdoll collides with certain objects but I don’t want to have to add the script to every body part of every ragdoll (as that would be very tedious). Ideally I would have one script only on the parent object of the ragdoll.

This is the code I want to run for every child object of the parent:

void OnCollisionEnter(Collision other)
{
Debug.Log (“Collision with object”);
}

You don’t have to. Just add it to the top-most parent with a rigidbody (root). Collision messages are sent through the object hierarchy.