---
title: "rotateTo(x:y:z:duration:)"
framework: scenekit
role: symbol
role_heading: Type Method
path: "scenekit/scnaction/rotateto(x:y:z:duration:)"
---

# rotateTo(x:y:z:duration:)

Creates an action that rotates the node to absolute angles in each of the three principal axes.

## Declaration

```swift
class func rotateTo(x xAngle: CGFloat, y yAngle: CGFloat, z zAngle: CGFloat, duration: TimeInterval) -> SCNAction
```

## Parameters

- `xAngle`: The amount to rotate the node counterclockwise around the x-axis of its local coordinate space, in radians.
- `yAngle`: The amount to rotate the node counterclockwise around the y-axis of its local coordinate space, in radians.
- `zAngle`: The amount to rotate the node counterclockwise around the z-axis of its local coordinate space, in radians.
- `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. Calling this method is equivalent to calling rotateTo(x:y:z:duration:usesShortestUnitArc:) and passing false for the shortestUnitArc parameter. This action is not reversible; the reverse of this action has the same duration but does not change anything.

## 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:usesShortestUnitArc:)](scenekit/scnaction/rotateto(x:y:z:duration:usesshortestunitarc:).md)
- [rotate(by:around:duration:)](scenekit/scnaction/rotate(by:around:duration:).md)
- [rotate(toAxisAngle:duration:)](scenekit/scnaction/rotate(toaxisangle:duration:).md)
