---
title: "rotate(toAngle:duration:shortestUnitArc:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skaction/rotate(toangle:duration:shortestunitarc:)"
---

# rotate(toAngle:duration:shortestUnitArc:)

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

## Declaration

```swift
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

Return Value A new action object.

## Discussion

Discussion When the action executes, the node’s 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.

## See Also

### Animating the Rotation of a Node

- [rotate(byAngle:duration:)](spritekit/skaction/rotate(byangle:duration:).md)
- [rotate(toAngle:duration:)](spritekit/skaction/rotate(toangle:duration:).md)
