---
title: "orient(to:offset:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skconstraint/orient(to:offset:)-1h1tw"
---

# orient(to:offset:)

Creates a constraint that forces a node to rotate to face another node.

## Declaration

```swift
class func orient(to node: SKNode, offset radians: SKRange) -> Self
```

## Parameters

- `node`: The node that should be used to orient the node that this constraint is attached to.
- `radians`: An offset that is added to the doc://com.apple.spritekit/documentation/SpriteKit/SKNode/zRotation value after it is calculated.

## Return Value

Return Value A new constraint.

## Discussion

Discussion Each time when constraints are applied, a new angle is calculated so that a line projected at this angle would point at the other node’s origin. This angle is added to the values specified in the radians property to create a new range. Finally, the node’s zRotation value is clamped to fit inside this range.

## See Also

### Creating Orientation Constraints

- [Creating a Look-At Constraint](spritekit/creating-a-look-at-constraint.md)
- [orient(to:offset:)](spritekit/skconstraint/orient(to:offset:)-9lq3h.md)
- [orient(to:in:offset:)](spritekit/skconstraint/orient(to:in:offset:).md)
- [zRotation(_:)](spritekit/skconstraint/zrotation(_:).md)
