<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/SkeletonResource/JointBuilder",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation16SkeletonResourceC12JointBuilderV"
  },
  "title" : "SkeletonResource.JointBuilder"
}
-->

# SkeletonResource.JointBuilder

A result builder for declaratively constructing the children of a joint.

```
@resultBuilder struct JointBuilder
```

## Overview

Inside the `Joint(_:restPoseTransform:children:)` closure, you can write any mix of:

- **`Joint` literals** — each becomes one child of the parent joint.
  
  ```swift
  try Joint("root") {
      try Joint("spine")
      try Joint("hip")
  }
  // root.children == [spine, hip]
  ```
- **`[Joint]` values** — each element becomes a child of the parent joint, in array
  order, alongside any other declarations in the same closure body. Use this when
  the children are produced from runtime data (e.g. mapped from a flat array) rather
  than spelled out as literals.
  
  ```swift
  let kids: [Joint] = ...
  try Joint("root") {
      kids   // every element of kids becomes a child of root
  }
  ```

Both forms can be mixed freely. Each `Joint` in any array can itself be a fully
built subtree.

## Topics

### Building joints

[`static func buildBlock([SkeletonResource.Joint]...) -> [SkeletonResource.Joint]`](/documentation/RealityKit/SkeletonResource/JointBuilder/buildBlock(_:))

Combines all joints declared in the closure body into the parent’s `children`.

### Type Methods

[`static buildExpression(_:)`](/documentation/RealityKit/SkeletonResource/JointBuilder/buildExpression(_:))

Treats a single `Joint` value in the closure body as one child of the parent.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)