# UpdateSegments(Span<ChainSegmentGeometry>, ReadOnlySpan<Vector2>, PhysicsTransform, bool)

> Update an existing batch of ChainSegmentGeometry from a set of vertices, writing the results into the specified span in place. This pairs with ChainSegmentGeometry.CreateSegments: it recalculates the same segment and ghost vertices, but reuses a caller-provided span rather than allocating a new one. The span length must equal the segment count the vertices produce, which is the vertex count when isLoop is true, otherwise the vertex count minus three.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/7000.0/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

```csharp
public static void UpdateSegments(Span<ChainSegmentGeometry> segments, ReadOnlySpan<Vector2> vertices, PhysicsTransform transform, bool isLoop)
```

### Parameters

**** (\[Span\<ChainSegmentGeometry>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): The segment batch to update in place. Its length must equal the segment count the vertices produce.**** (\[ReadOnlySpan\<Vector2>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The vertices to recalculate the segments from.**** (\[PhysicsTransform]\(/engine/7000.0/script-reference/unity/u2d/physics/physicstransform)): The transform used to specify where the geometry is positioned.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Indicates a closed chain formed by connecting the first and last vertices specified. This changes how the vertices are interpreted.
