public GameObject Child;
Child.transform.parent.gameObject.SetActive(false);
gameObject.transform.parent = null // Remove parent of Game Object
transform.parent = null;
public GameObject Child;
public Transform NewParent;
// Sets "newParent" as the new parent of the child GameObject.
Child.transform.SetParent(NewParent);
// Removes parent, puts child into a top-level object in the hierarchy
Child.transform.SetParent(null);
Destroy(transform.parent.gameObject);
transform.SetParent(parentTransform, true);
transform.SetParent(null, true);
transform.SetParent(parentTransform, true);
transform.SetParent(null, true);