unity how to change parent of gameobject while disabling code example
Example 1: set parent of gameobject unity
child.transform.SetParent(newParent);
Example 2: how to destroy parent gameobject unity
Destroy(transform.parent.gameObject);
child.transform.SetParent(newParent);
Destroy(transform.parent.gameObject);