Detect the collision of parent instead of object with the Script

hello my name is Rubens Torres am Brazilian do not speak English very well sorry for any typing error this is my first post here, I have a doubt in my script C# in Unity, I have an object named Player with a script called PlayerController and has a child named Legs, I was wondering if there is how to make the script the Player detects a collision of Player child in this case Legs, here is my script

public class playerController : MonoBehaviour {

public GameObject legs;


void OnCollisionStay(Collision collisionInfo) {

if(collisionInfo.gameObject.tag == "Ground")
{
print("Jump");
}

}
}

with it when the player collides with the object with tag SwithcMachine print runs, but I want that to happen when collided with the Legs instead of Player, if anyone knows any solution for this, please tell how to do thanks in advance.

You add a script to the legs that implements OnCollisionStay. In that method you call some function of the parent, the player controller.

@alexvda - yes it would work, but my object has several collision points as Legs I simplified the script for better understanding, I was wondering if it is possible to control all collision points for a script in which case the PlayerController, not to have to do a script for each point collision, for example Right Leg, Body, Left Arm … and others and do this for all enemies of the game would take a very large number of scripts, if necessary I will do but I was curious if there is a possibility to do this in one script for each enemy instead of a script for each member of it.