# CreateShapeBatch

> Create a batch of Circle shapes attached to this body.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.LowLevelPhysics2D](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d.md)
* **Assembly:** UnityEngine.Physics2DModule

## CreateShapeBatch(ReadOnlySpan\<CircleGeometry>, PhysicsShapeDefinition, Allocator)

Create a batch of Circle shapes attached to this body.

```csharp
public NativeArray<PhysicsShape> CreateShapeBatch(ReadOnlySpan<CircleGeometry> geometry, PhysicsShapeDefinition definition, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[ReadOnlySpan\<CircleGeometry>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The shape geometry to use.**** (\[PhysicsShapeDefinition]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshapedefinition)): The shape definition to use.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                            | Description                                                                                                                                    |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<PhysicsShape>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The created shapes. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## CreateShapeBatch(ReadOnlySpan\<PolygonGeometry>, PhysicsShapeDefinition, Allocator)

Create a batch of Polygon shapes attached to this body.

```csharp
public NativeArray<PhysicsShape> CreateShapeBatch(ReadOnlySpan<PolygonGeometry> geometry, PhysicsShapeDefinition definition, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[ReadOnlySpan\<PolygonGeometry>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The shape geometry to use.**** (\[PhysicsShapeDefinition]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshapedefinition)): The shape definition to use.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                            | Description                                                                                                                                    |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<PhysicsShape>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The created shapes. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## CreateShapeBatch(ReadOnlySpan\<CapsuleGeometry>, PhysicsShapeDefinition, Allocator)

Create a batch of Capsule shapes attached to this body.

```csharp
public NativeArray<PhysicsShape> CreateShapeBatch(ReadOnlySpan<CapsuleGeometry> geometry, PhysicsShapeDefinition definition, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[ReadOnlySpan\<CapsuleGeometry>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The shape geometry to use.**** (\[PhysicsShapeDefinition]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshapedefinition)): The shape definition to use.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                            | Description                                                                                                                                    |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<PhysicsShape>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The created shapes. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## CreateShapeBatch(ReadOnlySpan\<SegmentGeometry>, PhysicsShapeDefinition, Allocator)

Create a batch of Segment shapes attached to this body.

```csharp
public NativeArray<PhysicsShape> CreateShapeBatch(ReadOnlySpan<SegmentGeometry> geometry, PhysicsShapeDefinition definition, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[ReadOnlySpan\<SegmentGeometry>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The shape geometry to use.**** (\[PhysicsShapeDefinition]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshapedefinition)): The shape definition to use.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                            | Description                                                                                                                                    |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<PhysicsShape>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The created shapes. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## CreateShapeBatch(ReadOnlySpan\<ChainSegmentGeometry>, PhysicsShapeDefinition, Allocator)

Create a batch of Chain Segment shapes attached to this body.

```csharp
public NativeArray<PhysicsShape> CreateShapeBatch(ReadOnlySpan<ChainSegmentGeometry> geometry, PhysicsShapeDefinition definition, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[ReadOnlySpan\<ChainSegmentGeometry>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The shape geometry to use.**** (\[PhysicsShapeDefinition]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsshapedefinition)): The shape definition to use.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                            | Description                                                                                                                                    |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<PhysicsShape>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The created shapes. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |
