The GetAttachment
method retrieves the transform of a specified attachment point on a SceneModel
. This method can return the transform in either local or world space, depending on the worldspace
parameter.
The GetAttachment
method retrieves the transform of a specified attachment point on a SceneModel
. This method can return the transform in either local or world space, depending on the worldspace
parameter.
To use the GetAttachment
method, provide the name of the attachment point as a string and a boolean indicating whether you want the transform in world space. If the attachment point exists, the method returns a Transform
object; otherwise, it returns null
.
SceneModel model = new SceneModel(); string attachmentName = "hand_r"; bool inWorldSpace = true; Transform? attachmentTransform = model.GetAttachment(attachmentName, inWorldSpace); if (attachmentTransform.HasValue) { // Use the transform Transform transform = attachmentTransform.Value; // Perform operations with the transform } else { // Handle the case where the attachment does not exist }