<!--
{
  "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/PhysicsCustomJoint",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation18PhysicsCustomJointV"
  },
  "title" : "PhysicsCustomJoint"
}
-->

# PhysicsCustomJoint

A joint with six degrees of freedom that can be individually specified.

```
struct PhysicsCustomJoint
```

## Overview

A custom joint allows you to choose the restraints of all 6 degrees of freedom.
You can set a [`PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/MotionLimit) for each degrees’ motion.

> Note: By default all degrees of freedom are locked, similar to ``doc://com.apple.RealityKit/documentation/RealityKit/PhysicsFixedJoint``.

For example, you can constrain the motion of `pin1` in the xy-plane of `pin0`,
set movement along the x-axis to [`PhysicsCustomJoint.MotionLimit.unlimited`](/documentation/RealityKit/PhysicsCustomJoint/MotionLimit/unlimited),
and leave all rotations as the default value of [`PhysicsCustomJoint.MotionLimit.fixed`](/documentation/RealityKit/PhysicsCustomJoint/MotionLimit/fixed).

> Note: The xy-plane is a plane that aligns with the x and y axes.

```swift
let joint = PhysicsCustomJoint(
    pin0: entity0pin,
    pin1: entity1pin,
    linearMotionAlongX: .unlimited,
    linearMotionAlongY: .range(-5...5)
)
```

If `pin0` is in a fixed location for the example above,
this joint allows `pin1` to move
anywhere along the x-axis of `pin0`,
and can move up to 5 local meters above or below the y-axis of `pin0`.

## Topics

### Initializers

[`init(pin0: GeometricPin, pin1: GeometricPin, linearMotionAlongX: PhysicsCustomJoint.MotionLimit, linearMotionAlongY: PhysicsCustomJoint.MotionLimit, linearMotionAlongZ: PhysicsCustomJoint.MotionLimit, angularMotionAroundX: PhysicsCustomJoint.MotionLimit, angularMotionAroundY: PhysicsCustomJoint.MotionLimit, angularMotionAroundZ: PhysicsCustomJoint.MotionLimit, checksForInternalCollisions: Bool)`](/documentation/RealityKit/PhysicsCustomJoint/init(pin0:pin1:linearMotionAlongX:linearMotionAlongY:linearMotionAlongZ:angularMotionAroundX:angularMotionAroundY:angularMotionAroundZ:checksForInternalCollisions:))

Creates a new custom joint.

### Instance Properties

[`var angularMotionAroundX: PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/angularMotionAroundX)

The angular motion limits around the x-axis.

[`var angularMotionAroundY: PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/angularMotionAroundY)

The angular motion limits around the y-axis.

[`var angularMotionAroundZ: PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/angularMotionAroundZ)

The angular motion limits around the z-axis.

[`var linearMotionAlongX: PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/linearMotionAlongX)

The linear motion limits along the x-axis.

[`var linearMotionAlongY: PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/linearMotionAlongY)

The linear motion limits along the y-axis.

[`var linearMotionAlongZ: PhysicsCustomJoint.MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/linearMotionAlongZ)

The linear motion limits along the z-axis.

### Enumerations

[`enum MotionLimit`](/documentation/RealityKit/PhysicsCustomJoint/MotionLimit)

Specifies allowed linear or angular motion.

## Relationships

### Conforms To

[`PhysicsJoint`](/documentation/RealityKit/PhysicsJoint)

[`Equatable`](/documentation/Swift/Equatable)

---

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)