# Overlaps

> Returns true if the other rectangle overlaps this one. If allowInverse is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.

## Definition

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

## Overlaps(Rect)

Returns true if the other rectangle overlaps this one. If `allowInverse` is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.

```csharp
public readonly bool Overlaps(Rect other)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Other rectangle to test overlapping with.

### Returns

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

## Overlaps(Rect)

Returns true if the other rectangle overlaps this one. If `allowInverse` is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.

```csharp
public readonly bool Overlaps(in Rect other)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Other rectangle to test overlapping with.

### Returns

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

## Overlaps(Rect, bool)

Returns true if the other rectangle overlaps this one. If `allowInverse` is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.

```csharp
public readonly bool Overlaps(Rect other, bool allowInverse)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Other rectangle to test overlapping with.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Does the test allow the widths and heights of the Rects to be negative?

### Returns

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

## Overlaps(Rect, bool)

Returns true if the other rectangle overlaps this one. If `allowInverse` is present and true, the widths and heights of the Rects are allowed to take negative values (ie, the min value is greater than the max), and the test will still work.

```csharp
public readonly bool Overlaps(in Rect other, bool allowInverse)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Other rectangle to test overlapping with.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Does the test allow the widths and heights of the Rects to be negative?

### Returns

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