<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshResource/Skeleton/init(id:jointNames:inverseBindPoseMatrices:restPoseTransforms:parentIndices:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12MeshResourceC8SkeletonV2id10jointNames23inverseBindPoseMatrices04restK10Transforms13parentIndicesAESgSS_SaySSGSaySo13simd_float4x4aGSayAA9TransformVGSgSaySiSgGSgtcfc"
  },
  "title" : "init(id:jointNames:inverseBindPoseMatrices:restPoseTransforms:parentIndices:)"
}
-->

# init(id:jointNames:inverseBindPoseMatrices:restPoseTransforms:parentIndices:)

Creates a skeleton from arrays which define its joints. Returns `nil` if there was an
issue converting the parameters to a valid skeleton.

```
init?(id: String, jointNames: [String], inverseBindPoseMatrices: [simd_float4x4], restPoseTransforms: [Transform]? = nil, parentIndices: [Int?]? = nil)
```

## Parameters

`id`

The unique name of this skeleton.

`jointNames`

The names of each joint.

`inverseBindPoseMatrices`

The matrix which, for each joint, transforms from model
space (bind pose) to the local space of that joint.

`restPoseTransforms`

The transform from each joint’s local space to its parent’s local
space, used when the joint is not animated. If not specified, the rest pose is assumed to
be the same as the bind pose, and is computed from the inverse bind pose matrices.

`parentIndices`

The index of each joint’s parent, or nil if that joint has no parent.
If this array is not provided, the parent of each joint is inferred from its name (e.g.
a joint named `root/hips_joint` is parented to a joint named `root`).

## Discussion> Note: A parent joint needs to precede all of its child joints.

> Note: All the arrays passed to this initializer need to have the same length.

---

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)