# GetShapes(PhysicsShapeGroup2D)

> Gets all the PhysicsShape2D used by all Collider2D attached to the Rigidbody2D.

## Definition

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

```csharp
public int GetShapes(PhysicsShapeGroup2D physicsShapeGroup)
```

### Parameters

**** (\[PhysicsShapeGroup2D]\(/engine/6000.6/script-reference/unityengine/physicsshapegroup2d)): The [PhysicsShapeGroup2D](/engine/6000.6/script-reference/unityengine/physicsshapegroup2d.md) to store the retrieved [PhysicsShape2D](/engine/6000.6/script-reference/unityengine/physicsshape2d.md) in.

### Returns

| Type                                                       | Description                                                                                                                                                                                         |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns the number of [PhysicsShape2D](/engine/6000.6/script-reference/unityengine/physicsshape2d.md) retrieved from the [Rigidbody2D](/engine/6000.6/script-reference/unityengine/rigidbody2d.md). |

### Remarks

Where [Collider2D.GetShapes](/engine/6000.6/script-reference/unityengine/collider2d/getshapes.md) will retrieve all shapes used by a specific [Collider2D](/engine/6000.6/script-reference/unityengine/collider2d.md), this method will return all the shapes on all [Collider2D](/engine/6000.6/script-reference/unityengine/collider2d.md) attached to the [Rigidbody2D](/engine/6000.6/script-reference/unityengine/rigidbody2d.md).

For a complete description of how retrieving shapes works, refer to [Collider2D.GetShapes](/engine/6000.6/script-reference/unityengine/collider2d/getshapes.md).
