childObject.transform.parent.gameObject
// To get the parent object:
childObject.transform.parent.gameObject
public gameobject player
public gameobject Newparent
player.transform.parent = newParent.transform;
void OnCollisionEnter(Collision collision)
{
PlayerController pl = collision.gameObject.GetComponentInParent<PlayerController>();
}