<!--
{
  "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/SCNIKConstraint",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNIKConstraint"
  },
  "title" : "SCNIKConstraint"
}
-->

# SCNIKConstraint

A constraint that applies inverse kinematics to make a chain of nodes “reach” toward a target point.

```
class SCNIKConstraint
```

## Overview

![](images/com.apple.scenekit/media-2929777@2x.png)

*Inverse kinematics (IK)* is an iterative process that finds positions for the joints connecting a chain of rigid bodies in order to move the body at the end of that chain as close as possible to a desired point in space. For example, a chain of bodies might model a robot arm, and the node at the end of the chain—called an *end effector*—might model the hand or tool at the end of the arm. To create IK-based behavior in a SceneKit app or game, follow these steps:

1. Build a hierarchy of nodes whose [`position`](/documentation/SceneKit/SCNNode/position) and [`pivot`](/documentation/SceneKit/SCNNode/pivot) properties describe the joints between them. For example, the node representing a robot’s lower arm should be a child of its upper arm node, and the lower arm node’s [`pivot`](/documentation/SceneKit/SCNNode/pivot) property should be placed so that adjusting its [`rotation`](/documentation/SceneKit/SCNNode/rotation) property appears to bend the arm at an elbow joint. The robot’s hand should in turn be a child node of the lower arm node.
2. Create an [`SCNIKConstraint`](/documentation/SceneKit/SCNIKConstraint) object whose [`chainRootNode`](/documentation/SceneKit/SCNIKConstraint/chainRootNode) property refers to the highest node in the hierarchy whose orientation should be adjusted by the constraint. Continuing the previous example, the root of the chain should be the node containing the upper arm (not the robot’s body, whose orientation remains fixed).
3. Apply the IK constraint to the end effector node of the chain with that node’s [`constraints`](/documentation/SceneKit/SCNNode/constraints) property. In the robot arm example, the end effector is the hand or tool at the end of the arm.
4. (Optional) Limit the range of motion of one or more joints in the chain with the [`setMaxAllowedRotationAngle(_:forJoint:)`](/documentation/SceneKit/SCNIKConstraint/setMaxAllowedRotationAngle(_:forJoint:)) method.
5. To set the constrained nodes in motion, provide a target position for the constraint with its [`targetPosition`](/documentation/SceneKit/SCNIKConstraint/targetPosition) property. You can animate a change to this property

> Note:
> SceneKit’s physics and inverse kinematics simulations are separate. When SceneKit prepares to render a scene, it processes the physics simulation before applying constraints (including IK constraints). As a result, the effects of an IK constraint override the results of the physics simulation. To use physics with a node also affected by constraints, the node’s ``doc://com.apple.scenekit/documentation/SceneKit/SCNNode/physicsBody`` object must be a kinematic physics body.

## Topics

### Creating an Inverse Kinematics Constraint

[`-  initWithChainRootNode:`](/documentation/SceneKit/SCNIKConstraint/init(chainRootNode:))

Initializes an inverse kinematics constraint whose chain of nodes begins with the specified node.

[`+  inverseKinematicsConstraintWithChainRootNode:`](/documentation/SceneKit/SCNIKConstraint/inverseKinematicsConstraint(chainRootNode:))

Creates an inverse kinematics constraint whose chain of nodes begins with the specified node.

### Adjusting the Constraint’s Limits of Motion

[`chainRootNode`](/documentation/SceneKit/SCNIKConstraint/chainRootNode)

The parent node of the hierarchy affected by the constraint.

[`-  maxAllowedRotationAngleForJoint:`](/documentation/SceneKit/SCNIKConstraint/maxAllowedRotationAngle(forJoint:))

Returns the rotation limit, in degrees, for the specified node.

[`-  setMaxAllowedRotationAngle:forJoint:`](/documentation/SceneKit/SCNIKConstraint/setMaxAllowedRotationAngle(_:forJoint:))

Sets the rotation limit, in degrees, for the specified node.

### Applying Inverse Kinematics to the Constrained Node

[`targetPosition`](/documentation/SceneKit/SCNIKConstraint/targetPosition)

The desired position for the constrained node, in the scene’s world coordinate space. Animatable.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)