Need to get parent Object after collision

I’ve got same troubles with getting parent Object.
My object Monster has a MonsterBody Component. After collision with MonsterBody I need to let my Monster know, that he’s been attacked. I’ve made some research, but it didn’t work anyway. I guess, I don’t get how parents really works. Here’s the code:

if (collider.tag == "MonsterBody") collider.GetComponent(),MonsterBody,.transform.parent.gameObject.GetComponent,Monster,().GetHit(BaseDamage*DamageMOD);

I’ll glad if you could help me. I’m not really interested in Scripting GetHit() in my MonsterBody, except is the only way.

EDIT: I used “,” instead of “<>”, cause it seems not working here.

Okay, well, to start with…
collider.tag is always going to be the tag of the object this script is on. So it will always be true or false.

Thats because “MonoBehaviour.collider” is a short cut for for “MonoBheaviour.gameobject.collider”

I strongly suspect thats not what you want.

Similarly 'collider.GetComponent().transform.parent" is going to be the same as “transform.parent” or again, the parent of the transform of the game object this script is on.

To get the object collided with, and its parent object, you need to do something like this:

void OnCollisionEnter(Collision collision){
  GameObject other  = collision.gameObject;
  GameObject otherParent = other.transform.parent.gameObject;
}