Version: 2017.1
public Vector3 size ;

Descripción

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

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

using UnityEngine;
using System.Collections;

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