<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNPhysicsBallSocketJoint",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsBallSocketJoint"
  },
  "title" : "SCNPhysicsBallSocketJoint"
}
-->

# SCNPhysicsBallSocketJoint

A physics behavior that connects two physics bodies and allows them to pivot around each other in any direction.

```
class SCNPhysicsBallSocketJoint
```

## Overview

A ball and socket joint has three rotational degrees of freedom and zero translational degrees of freedom. You can also use a ball and socket joint to pin a body to a specific location in the coordinate space of the node containing it while allowing it to rotate freely.

## Topics

### Creating a Ball and Socket Joint

[`+  jointWithBodyA:anchorA:bodyB:anchorB:`](/documentation/SceneKit/SCNPhysicsBallSocketJoint/init(bodyA:anchorA:bodyB:anchorB:))

Creates a ball and socket joint connecting two physics bodies.

[`+  jointWithBody:anchor:`](/documentation/SceneKit/SCNPhysicsBallSocketJoint/init(body:anchor:))

Creates a ball and socket joint that anchors a single physics body in space and allows it to rotate freely around an anchor point.

### Managing the Characteristics of a Ball and Socket Joint

[`bodyA`](/documentation/SceneKit/SCNPhysicsBallSocketJoint/bodyA)

The first physics body connected by the joint.

[`anchorA`](/documentation/SceneKit/SCNPhysicsBallSocketJoint/anchorA)

The point at which the joint connects, relative to the node containing the first body.

[`bodyB`](/documentation/SceneKit/SCNPhysicsBallSocketJoint/bodyB)

The second physics body connected by the joint.

[`anchorB`](/documentation/SceneKit/SCNPhysicsBallSocketJoint/anchorB)

The point at which the joint connects, relative to the node containing the second body.

## Relationships

### Inherits From

[`SCNPhysicsBehavior`](/documentation/SceneKit/SCNPhysicsBehavior)

### Conforms To

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

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

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

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

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

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

---

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)