---
title: "position(at:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/clothmeshresource/position(at:)"
---

# position(at:)

Returns the position of the vertex at the given index.

## Declaration

```swift
final func position(at vertexIndex: UInt32) -> SIMD3<Float>
```

## Parameters

- `vertexIndex`: Index of the vertex to get the position for.

## Return Value

Return Value The position of the specified vertex.

## Discussion

Discussion If you want to obtain the position for a specific vertex within a specific primitive (for example the third vertex of the 20th triangle in a triangle mesh), you can use vertexIndex(at:) to obtain the right vertex index: let vertexIndex = myMesh.vertexIndex(at: 3 * 19 + 2) let vertexPosition = myMesh.position(at: vertexIndex) print("The third vertex of the 20th triangle is at X=\(vertexPosition.x)") warning: This returned position corresponds to the mesh used to generate the bodies, rather than the bodies themselves. Therefore, this position does not change as the body deforms when this resource is used in mesh.

## See Also

### Accessing vertex data

- [vertexCount](realitykit/clothmeshresource/vertexcount.md)
- [positions](realitykit/clothmeshresource/positions.md)
- [withPositions(_:)](realitykit/clothmeshresource/withpositions(_:).md)
- [vertexIndex(at:)](realitykit/clothmeshresource/vertexindex(at:).md)
- [vertexIndex(primitive:vertex:)](realitykit/clothmeshresource/vertexindex(primitive:vertex:).md)
- [vertices(in:center:orientation:)](realitykit/clothmeshresource/vertices(in:center:orientation:).md)
