<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/pins",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC4pinsAA0C13GeometricPinsVvp"
  },
  "title" : "pins"
}
-->

# pins

The entity’s geometric pins.

```
@MainActor @preconcurrency var pins: EntityGeometricPins { get }
```

## Discussion

You can look up, add, and remove a [`GeometricPin`](/documentation/RealityKit/GeometricPin) for the owning entity
through this [`EntityGeometricPins`](/documentation/RealityKit/EntityGeometricPins) instance.
The entity’s [`GeometricPinsComponent`](/documentation/RealityKit/GeometricPinsComponent) stores any added geometric pins.

Other [`Component`](/documentation/RealityKit/Component) types on an [`Entity`](/documentation/RealityKit/Entity) may also provide [`GeometricPin`](/documentation/RealityKit/GeometricPin) instances,
such as for skeletal pose joints.
There is no distinction between these two when [`GeometricPin`](/documentation/RealityKit/GeometricPin) instances are accessed.

### Geometric pins for skeletal pose joints

Pins for skeletal pose joints are not predefined, they need to be set in entity’s GeometricPinsComponent before you can access them. When associating a pin with a skeletal pose joint, you need to pass in the
correct joint names either in full pose joint name or with its leaf joint name:

```swift
let fullNamePin = skeletalPoseEntity.pins.set(named: "fullName", skeletalJointName: "root/hips_joint/spine_1_joint/spine_2_joint")
let shortNamePin = skeletalPoseEntity.pins.set(named: "shortName", skeletalJointName: "spine_2_joint")
```

The pose (position and orientation) of the [`GeometricPin`](/documentation/RealityKit/GeometricPin) is the current pose of the joint
in the coordinate frame of the [`Entity`](/documentation/RealityKit/Entity) (i.e. *not* relative to the parent joint).
While the skeletal pose is animated, the [`GeometricPin`](/documentation/RealityKit/GeometricPin) pose change on every frame.

To print all the pins, you can loop over [`pins`](/documentation/RealityKit/Entity/pins).

```swift
for pin in skeletalPoseEntity.pins {
    print("joint   name: \(pin.name)")        // Full joint path name.
    print("    position: \(pin.position)")    // In coordinate frame of skeletalPoseEntity.
    print(" orientation: \(pin.orientation)") // In coordinate frame of skeletalPoseEntity.
}
```

In skeletal pose joint names, prefix the characters
`.`, `[`, `]` and `\`
with an escaping character (`\`).

For example, to access a skeletal pose joint named `"my.joint"`:

```swift
// To include a literal backslash in a string,
// escape it with an additional backslash.
let myJointPinEscaped = skeletalPoseEntity.pins.set(named: "myJointPinEscaped", skeletalJointName: "my\\.joint")
// Alternatively, use Swift's raw string feature
// by enclosing the string in # symbols.
let myJointPinRaw = skeletalPoseEntity.pins.set(named: "myJointPinEscaped", skeletalJointName: #"my\.joint"#)
```

> Note: Character escaping is only required for skeletal pose joints.

---

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)