# size

> The size of the obstacle, measured in the object's local space.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.AI](/engine/6000.7/script-reference/unityengine/ai.md)
* **Assembly:** UnityEngine.AIModule

```csharp
public Vector3 size { get; set; }
```

### Remarks

The size will be scaled by the transform's scale.

### Examples

```csharp
using UnityEngine;
using UnityEngine.AI;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        NavMeshObstacle obstacle = GetComponent<NavMeshObstacle>();
        Mesh mesh = GetComponent<MeshFilter>().mesh;
        obstacle.shape = NavMeshObstacleShape.Box;
        obstacle.size = mesh.bounds.size;
    }
}
```
