<!--
{
  "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/SCNPhysicsSliderJoint/init(bodyA:axisA:anchorA:bodyB:axisB:anchorB:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsSliderJoint(cm)jointWithBodyA:axisA:anchorA:bodyB:axisB:anchorB:"
  },
  "title" : "init(bodyA:axisA:anchorA:bodyB:axisB:anchorB:)"
}
-->

# init(bodyA:axisA:anchorA:bodyB:axisB:anchorB:)

Creates a slider joint connecting two physics bodies.

```
convenience init(bodyA: SCNPhysicsBody, axisA: SCNVector3, anchorA: SCNVector3, bodyB: SCNPhysicsBody, axisB: SCNVector3, anchorB: SCNVector3)
```

## Parameters

`bodyA`

The first physics body to be connected by the joint.

`axisA`

The axis along which the first body can slide, relative to the node containing it.

`anchorA`

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

`bodyB`

The second physics body to be connected by the joint.

`axisB`

The axis along which the second body can slide, relative to the node containing it.

`anchorB`

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

## Return Value

A new slider joint behavior.

## Discussion

This method defines the location where the bodies are pinned together. To define their sliding or rotation motion relative to that point, use the properties listed in Limiting the Motion of a Slider Joint.

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)