---
title: "withSimulationSpacePositions(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/clothbodyevents/newsimulationpositions/withsimulationspacepositions(_:)"
---

# withSimulationSpacePositions(_:)

Provides access to the new simulation positions of the body’s particles, in simulation space.

## Declaration

```swift
func withSimulationSpacePositions<Result>(_ body: (Span<SIMD3<Float>>) -> Result) -> Result
```

## Parameters

- `body`: A closure that receives a span over the simulation-space particle positions.

## Return Value

Return Value The value returned by body.

## Discussion

Discussion The provided span is only valid for the lifetime of the callback.

## See Also

### Accessing simulation space positions

- [simulationSpacePositions](realitykit/clothbodyevents/newsimulationpositions/simulationspacepositions.md)
