---
title: "init(body:axis:anchor:)"
framework: scenekit
role: symbol
role_heading: Initializer
path: "scenekit/scnphysicshingejoint/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.

## Declaration

```swift
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

Return Value A new hinge joint behavior.

## Discussion

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

## See Also

### Creating a Hinge Joint

- [init(bodyA:axisA:anchorA:bodyB:axisB:anchorB:)](scenekit/scnphysicshingejoint/init(bodya:axisa:anchora:bodyb:axisb:anchorb:).md)
