Access parent of gameobject

Hi

How can I access the parent of another game object when colliding with a child only.
I want to access a variable in the parent script.

For example:

function OnTriggerEnter(other: Collider){
other.parent.GetComponent("Script").variable = someVariable;
}

Use

other.transform.parent

to get the transform parent.

Use

other.transform.root

to get the root transform (the one that doesn’t have a parent).