The AddChild
method allows you to add a child SceneObject
to the current SceneObject
. This establishes a parent-child relationship between the two objects, where the child will inherit transformations and other properties from the parent.
The AddChild
method allows you to add a child SceneObject
to the current SceneObject
. This establishes a parent-child relationship between the two objects, where the child will inherit transformations and other properties from the parent.
To use the AddChild
method, you need to provide a name for the child object and the SceneObject
instance that you want to add as a child. The name is a string identifier for the child object within the context of the parent.
// Create a new SceneObject SceneObject parentObject = new SceneObject(); SceneObject childObject = new SceneObject(); // Add the child object to the parent object parentObject.AddChild("ChildName", childObject);