<!--
{
  "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/SCNPhysicsHingeJoint/init(body:axis:anchor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsHingeJoint(cm)jointWithBody:axis:anchor:"
  },
  "title" : "init(body:axis:anchor:)"
}
-->

# init(body:axis:anchor:)

Creates a hinge joint that anchors a single physics body in space and lets it rotate around a specific axis.

```
convenience init(body: SCNPhysicsBody, axis: SCNVector3, anchor: SCNVector3)
```

## Parameters

`body`

The physics body to be controlled by the hinge joint.

`axis`

The direction of the axis that the body pivots around, relative to the node containing the body.

`anchor`

The location of the axis in the node containing the body.

## Return Value

A new hinge joint behavior.

## Discussion

For a behavior to take effect, add it to the physics simulation by calling the [`addBehavior(_:)`](/documentation/SceneKit/SCNPhysicsWorld/addBehavior(_:)) method on your scene’s [`SCNPhysicsWorld`](/documentation/SceneKit/SCNPhysicsWorld) object. The physics bodies constrained by the joint must be attached to nodes in the scene.

---

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)