unity set parent to root

Code Example - unity set parent to root

                
                        gameObject.transform.parent = null;