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);
transform.SetParent(parentTransform, true);
transform.SetParent(null, true);
transform.SetParent(parentTransform, true);
transform.SetParent(null, true);