SceneObject Parent { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Parent property of a SceneObject represents the movement parent of the scene object, if any. This property allows you to get or set the parent SceneObject to which the current object is attached. If the Parent is set, the current object's transform, position, and rotation are relative to this parent. If no parent is set, these properties are relative to the SceneWorld.

Usage

To use the Parent property, you can simply access it directly from a SceneObject instance. You can assign another SceneObject to it to set a new parent, or retrieve the current parent to perform operations based on the hierarchy.

Example

// Example of setting a parent for a SceneObject
SceneObject childObject = new SceneObject();
SceneObject parentObject = new SceneObject();

// Set the parent of the childObject
childObject.Parent = parentObject;

// Access the parent of the childObject
SceneObject currentParent = childObject.Parent;

// Check if the childObject has a parent
if (currentParent != null)
{
    // Perform operations knowing the object has a parent
}