---
title: "setOrientation(_:duration:relative:)"
framework: dockkit
role: symbol
role_heading: Instance Method
path: "dockkit/dockaccessory/setorientation(_:duration:relative:)-84z7i"
---

# setOrientation(_:duration:relative:)

Sets the position of each axis of orientation to radians for pitch, yaw, and roll.

## Declaration

```swift
final func setOrientation(_ rotation: Vector3D, duration: Duration = .seconds(0), relative: Bool = false) async throws -> Progress
```

## Parameters

- `rotation`: The spatial framework’s Vector3D with X, Y, and Z corresponding to radians of pitch, yaw, and roll axes.
- `duration`: The duration, in seconds, to reach the target orientation.
- `relative`: Calculate the relative-to-current positions, if set to true; otherwise, move to an absolute position.

## Return Value

Return Value An object that reports progress during the animation sequence.

## Discussion

Discussion This method works only when you disable system tracking. note: DockKitError.frameRateTooHigh if calling the method too frequently, or DockKitError.notSupported in macOS.
