---
title: "rotate(byAngle:duration:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skaction/rotate(byangle:duration:)"
---

# rotate(byAngle:duration:)

Creates an action that rotates the node by a relative value.

## Declaration

```swift
class func rotate(byAngle radians: CGFloat, duration: TimeInterval) -> SKAction
```

## Parameters

- `radians`: The amount to rotate the node, in radians.
- `duration`: The duration of the animation.

## Return Value

Return Value A new action object.

## Discussion

Discussion When the action executes, the node’s zRotation property animates to the new angle. This action is reversible; the reverse is created as if the following code is executed:

## See Also

### Animating the Rotation of a Node

- [rotate(toAngle:duration:)](spritekit/skaction/rotate(toangle:duration:).md)
- [rotate(toAngle:duration:shortestUnitArc:)](spritekit/skaction/rotate(toangle:duration:shortestunitarc:).md)
