Skip to content

format

typescript
NavMeshObstacle.size

class: NavMeshObstacle

description

The length of the Box in the x, y, and z directions.

When the shape is Box, the extend represents the length of the Box in the x, y, and z directions. When the shape is Cylinder, reading the extend is an invalid operation.

parameter

param_nametypedescription

reture

typedescription
Vector3The length of the Box in the x, y, and z directions.

code example

typescript
let obj = new GameObject();
let com = obj.AddComponent<NavMeshObstacle>(NavMeshObstacle);

com.shape = NavMeshObstacleShape.Box;
com.centerOffset = new Vector3(0, 1, 0);
com.size = new Vector3(1, 1, 1);
Debug.Log("NavMeshObstacle: size = ", com.size);