unity set parent to root code example Example: unity set parent to root gameObject.transform.parent = null;