<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKConstraint/zRotation(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKConstraint(cm)zRotation:"
  },
  "title" : "zRotation(_:)"
}
-->

# zRotation(_:)

Creates a constraint that limits the orientation of a node.

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

## Parameters

`zRange`

A range value that specifies the minimum and maximum values of the node’s [`zRotation`](/documentation/SpriteKit/SKNode/zRotation) property.

## Return Value

A new constraint.

## Discussion

Each time when constraints are applied, the node’s [`zRotation`](/documentation/SpriteKit/SKNode/zRotation) property is clamped so that it is within the specified range.

---

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)