<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GroupActivities",
  "identifier" : "/documentation/GroupActivities/SpatialTemplateElementPosition/offsetBy(x:z:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Group Activities"
    ],
    "preciseIdentifier" : "s:15GroupActivities30SpatialTemplateElementPositionV8offsetBy1x1zACSd_SdtF"
  },
  "title" : "offsetBy(x:z:)"
}
-->

# offsetBy(x:z:)

Returns a new position at the specified distance from the origin
of the shared coordinate space.

```
func offsetBy(x: Double, z: Double) -> SpatialTemplateElementPosition
```

## Parameters

`x`

The distance from the current position, in meters, along
the x-axis. You can specify positive or negative values to
specify new positions on either side of the original position.

`z`

The distance from the current position, in meters, along
the z-axis. You can specify positive or negative values to specify
new positions on either side of the original position.

## Return Value

A position structure with the specified offsets from the
current position.

## Discussion

Use this method to adjust an existing position by the specified number
of meters. The x- and y-axes form a plane that is horizontal to the
ground. The following example creates a new position that is four
meters from the app’s content along the z-axis:

```swift
let audienceCenterPoint = SpatialTemplateElementPosition.app.offsetBy(x: 0, z: 4)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)