# TestOverlapShape

> Tests if the provided shape overlaps any shapes. The selected shape is excluded from any results and must be in this world otherwise a warning will be produced.

## Definition

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

## TestOverlapShape(PhysicsShape, QueryFilter)

Tests if the provided shape overlaps any shapes. The selected shape is excluded from any results and must be in this world otherwise a warning will be produced.

```csharp
public bool TestOverlapShape(PhysicsShape shape, PhysicsQuery.QueryFilter filter)
```

### Parameters

**** (\[PhysicsShape]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsshape)): The shape used to check overlap.**** (\[QueryFilter]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/queryfilter)): The filter to control the result returned.

### Returns

| Type                                                          | Description                     |
| ------------------------------------------------------------- | ------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If the query overlaps anything. |

## TestOverlapShape(PhysicsShape, Vector2, QueryFilter)

Tests if the provided shape overlaps any shapes. The selected shape is excluded from any results and must be in this world otherwise a warning will be produced.

```csharp
public bool TestOverlapShape(PhysicsShape shape, Vector2 origin, PhysicsQuery.QueryFilter filter)
```

### Parameters

**** (\[PhysicsShape]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsshape)): The shape used to check overlap.**** (\[Vector2]\(/engine/6000.7/script-reference/unityengine/vector2)): The point, in world space, the shape's local geometry is tested at. The shape's body is not moved and its position is not used, so the same shape can be tested anywhere.**** (\[QueryFilter]\(/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/queryfilter)): The filter to control the result returned.

### Returns

| Type                                                          | Description                     |
| ------------------------------------------------------------- | ------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If the query overlaps anything. |
