unity set parent to root
Code Example - unity set parent to root
gameObject.transform.parent = null;
gameObject.transform.parent = null;