The RemoveChild
method is used to remove a specified child SceneObject
from the current SceneObject
. This operation detaches the child from its parent, effectively removing it from the scene hierarchy under this object.
The RemoveChild
method is used to remove a specified child SceneObject
from the current SceneObject
. This operation detaches the child from its parent, effectively removing it from the scene hierarchy under this object.
To use the RemoveChild
method, you need to have a reference to the parent SceneObject
and the child SceneObject
you wish to remove. Call the method on the parent object, passing the child object as a parameter.
// Assume 'parentObject' is a SceneObject with children // and 'childObject' is a SceneObject that is a child of 'parentObject' parentObject.RemoveChild(childObject); // After this call, 'childObject' will no longer be a child of 'parentObject'.