<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKAction/rotate(toAngle:duration:shortestUnitArc:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAction(cm)rotateToAngle:duration:shortestUnitArc:"
  },
  "title" : "rotate(toAngle:duration:shortestUnitArc:)"
}
-->

# rotate(toAngle:duration:shortestUnitArc:)

Creates an action that rotates the node to an absolute value.

```
class func rotate(toAngle radians: CGFloat, duration: TimeInterval, shortestUnitArc: Bool) -> SKAction
```

## Parameters

`radians`

The angle to rotate the node to, in radians.

`duration`

The duration of the animation.

`shortestUnitArc`

If <doc://com.apple.documentation/documentation/Swift/true>, the rotation is performed in whichever direction results in the smallest rotation. If <doc://com.apple.documentation/documentation/Swift/false>, the rotation is interpolated.

## Return Value

A new action object.

## Discussion

When the action executes, the node’s [`zRotation`](/documentation/SpriteKit/SKNode/zRotation) property is animated to the new angle.

This action is not reversible; the reverse of this action has the same duration but does not change anything.

---

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)