Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity3d remove parent

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);
 
PREVIOUS NEXT
Tagged: #remove #parent
ADD COMMENT
Topic
Name
1+7 =