# Contains

> Is point contained in the bounding box?

## Definition

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

## Contains(Vector3)

Is `point` contained in the bounding box?

```csharp
public readonly bool Contains(Vector3 point)
```

### Parameters

**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)):&#x20;

### Returns

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

### Remarks

If the `point` passed into [Bounds.Contains](/engine/6000.5/script-reference/unityengine/bounds/contains.md) is inside the bounding box a value of True is returned. Points on the min and max limits (corners and edges) of the bounding box are considered inside.

**Note:** If [Bounds.extents](/engine/6000.5/script-reference/unityengine/bounds/extents.md) contains a negative value in any coordinate then [Bounds.Contains](/engine/6000.5/script-reference/unityengine/bounds/contains.md) will always return False.

### Examples

```csharp
//Attach this script to a GameObject with a Collider component
//Create an empty GameObject (<b>Create</b>><b>Create Empty</b>) and attach it in the New Transform field in the Inspector of the first GameObject
//This script tells if a point  you specify (the position of the empty GameObject) is within the first GameObject’s Collider

using UnityEngine;

public class Example : MonoBehaviour
{
    //Make sure to assign this in the Inspector window
    public Transform m_NewTransform;
    Collider m_Collider;
    Vector3 m_Point;

    void Start()
    {
        //Fetch the Collider from the GameObject this script is attached to
        m_Collider = GetComponent<Collider>();
        //Assign the point to be that of the Transform you assign in the Inspector window
        m_Point = m_NewTransform.position;
    }

    void Update()
    {
        //If the first GameObject's Bounds contains the Transform's position, output a message in the console
        if (m_Collider.bounds.Contains(m_Point))
        {
            Debug.Log("Bounds contain the point : " + m_Point);
        }
    }
}
```

## Contains(Vector3)

Is `point` contained in the bounding box?

```csharp
public readonly bool Contains(in Vector3 point)
```

### Parameters

**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)):&#x20;

### Returns

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

### Remarks

If the `point` passed into [Bounds.Contains](/engine/6000.5/script-reference/unityengine/bounds/contains.md) is inside the bounding box a value of True is returned. Points on the min and max limits (corners and edges) of the bounding box are considered inside.

**Note:** If [Bounds.extents](/engine/6000.5/script-reference/unityengine/bounds/extents.md) contains a negative value in any coordinate then [Bounds.Contains](/engine/6000.5/script-reference/unityengine/bounds/contains.md) will always return False.

### Examples

```csharp
//Attach this script to a GameObject with a Collider component
//Create an empty GameObject (<b>Create</b>><b>Create Empty</b>) and attach it in the New Transform field in the Inspector of the first GameObject
//This script tells if a point  you specify (the position of the empty GameObject) is within the first GameObject’s Collider

using UnityEngine;

public class Example : MonoBehaviour
{
    //Make sure to assign this in the Inspector window
    public Transform m_NewTransform;
    Collider m_Collider;
    Vector3 m_Point;

    void Start()
    {
        //Fetch the Collider from the GameObject this script is attached to
        m_Collider = GetComponent<Collider>();
        //Assign the point to be that of the Transform you assign in the Inspector window
        m_Point = m_NewTransform.position;
    }

    void Update()
    {
        //If the first GameObject's Bounds contains the Transform's position, output a message in the console
        if (m_Collider.bounds.Contains(m_Point))
        {
            Debug.Log("Bounds contain the point : " + m_Point);
        }
    }
}
```
