---
title: "zRotation(_:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skconstraint/zrotation(_:)"
---

# zRotation(_:)

Creates a constraint that limits the orientation of a node.

## Declaration

```swift
class func zRotation(_ zRange: SKRange) -> Self
```

## Parameters

- `zRange`: A range value that specifies the minimum and maximum values of the node’s doc://com.apple.spritekit/documentation/SpriteKit/SKNode/zRotation property.

## Mentioned in

Creating a Look-At Constraint

## Return Value

Return Value A new constraint.

## Discussion

Discussion Each time when constraints are applied, the node’s zRotation property is clamped so that it is within the specified 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:)-1h1tw.md)
- [orient(to:offset:)](spritekit/skconstraint/orient(to:offset:)-9lq3h.md)
- [orient(to:in:offset:)](spritekit/skconstraint/orient(to:in:offset:).md)
