# PhysicsShapeGroup2D(int, int)

> Initializes and returns an instance of PhysicsShapeGroup2D. The shape group will be empty and ready for use by Collider2D.GetShapes, Rigidbody2D.GetShapes or manually adding shapes.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.Physics2DModule

```csharp
public PhysicsShapeGroup2D(int shapeCapacity = 1, int vertexCapacity = 8)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The initial capacity of the [PhysicsShape2D](/engine/6000.0/script-reference/unityengine/physicsshape2d.md) list used to contain the shapes.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The initial capacity of the [vertices](/engine/6000.0/script-reference/unityengine/vector2.md) list used to contain the shape geometry.

### Remarks

Both the shapeCapacity and  vertexCapacity should be set high enough so that new allocations are not required and therefore no garbage collection work is produced.
