---
title: "rotate(by:around:duration:)"
framework: scenekit
role: symbol
role_heading: Type Method
path: "scenekit/scnaction/rotate(by:around:duration:)"
---

# rotate(by:around:duration:)

Creates an action that rotates the node by an angle around a specified axis.

## Declaration

```swift
class func rotate(by angle: CGFloat, around axis: SCNVector3, duration: TimeInterval) -> SCNAction
```

## Parameters

- `angle`: The amount to rotate the node counterclockwise around the specified axis, in radians.
- `axis`: A vector in the node’s local coordinate space whose direction specifies the axis of rotation.
- `duration`: The duration, in seconds, of the animation.

## Return Value

Return Value A new action object.

## Discussion

Discussion When the action executes, the node’s rotation property animates to the new angle. This action is reversible; the reverse is created as if the following code had been executed: [SCNAction rotateByAngle: -angle aroundAxis: axis duration: sec];

## See Also

### Creating Actions That Rotate a Node

- [rotateBy(x:y:z:duration:)](scenekit/scnaction/rotateby(x:y:z:duration:).md)
- [rotateTo(x:y:z:duration:)](scenekit/scnaction/rotateto(x:y:z:duration:).md)
- [rotateTo(x:y:z:duration:usesShortestUnitArc:)](scenekit/scnaction/rotateto(x:y:z:duration:usesshortestunitarc:).md)
- [rotate(toAxisAngle:duration:)](scenekit/scnaction/rotate(toaxisangle:duration:).md)
