# Contains

> Returns true if the given position is within the RectInt.

## Definition

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

## Contains(Vector2Int)

Returns true if the given position is within the [RectInt](/engine/6000.6/script-reference/unityengine/rectint.md).

```csharp
public readonly bool Contains(Vector2Int position)
```

### Parameters

**** (\[Vector2Int]\(/engine/6000.6/script-reference/unityengine/vector2int)): Position to check.

### Returns

| Type                                                          | Description                                                                                           |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Whether the position is within the [RectInt](/engine/6000.6/script-reference/unityengine/rectint.md). |

### Remarks

A point is considered to lie within the RectInt if its coordinates are greater than or equal to the RectInt's min coordinates, and less than the RectInt's max coordinates.

## Contains(Vector2Int)

Returns true if the given position is within the [RectInt](/engine/6000.6/script-reference/unityengine/rectint.md).

```csharp
public readonly bool Contains(in Vector2Int position)
```

### Parameters

**** (\[Vector2Int]\(/engine/6000.6/script-reference/unityengine/vector2int)): Position to check.

### Returns

| Type                                                          | Description                                                                                           |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Whether the position is within the [RectInt](/engine/6000.6/script-reference/unityengine/rectint.md). |

### Remarks

A point is considered to lie within the RectInt if its coordinates are greater than or equal to the RectInt's min coordinates, and less than the RectInt's max coordinates.
