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

# SCNLookAtConstraint

A constraint that orients a node to always point toward a specified other node.

```
class SCNLookAtConstraint
```

## Overview

For example, you can use a look-at constraint to ensure that a camera or spotlight always follows the movement of a game character. To attach constraints to an [`SCNNode`](/documentation/SceneKit/SCNNode) object, use its [`constraints`](/documentation/SceneKit/SCNNode/constraints) property.

A node points in the direction of the negative z-axis of its local coordinate system. This axis defines the view direction for nodes containing cameras and the lighting direction for nodes containing spotlights or directional lights, as well as the orientation of the node’s geometry and child nodes. When Scene Kit evaluates a look-at constraint, it updates the constrained node’s [`transform`](/documentation/SceneKit/SCNNode/transform) property so that the node’s negative z-axis points toward the constraint’s target node.

## Topics

### Creating a Look-At Constraint

[`+  lookAtConstraintWithTarget:`](/documentation/SceneKit/SCNLookAtConstraint/init(target:))

Creates a look-at constraint for a specified target node.

### Modifying a Constraint

[`gimbalLockEnabled`](/documentation/SceneKit/SCNLookAtConstraint/isGimbalLockEnabled)

A Boolean value that specifies whether constrained nodes are allowed to rotate.

[`target`](/documentation/SceneKit/SCNLookAtConstraint/target)

The node toward which constrained nodes will point after being reoriented.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

### 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)