NavMesh Obstacle component reference
The NavMesh Obstacle component allows you to define obstacles that NavMesh Agents should avoid as they navigate the world (for example, barrels or crates controlled by the physics system). It contains properties that allow you to define the size, shape, and behavior of the obstacle.
To use the NavMesh component you need to add it to a game object as follows:
- Select the GameObject you want to use as an obstacle.
- In the Inspector select Add Component, then select Navigation > NavMesh Obstacle.
The NavMesh Obstacle component is displayed in the Inspector window.
You can use this component to create NavMesh obstacles. For more information, see Create a NavMesh Obstacle. For more information on NavMesh obstacles and how to use them, see About NavMesh obstacles.
The following table describes the properties available in the NavMesh Obstacle component.
Property | Description |
---|---|
Shape | Specify the shape of the obstacle geometry. Choose whichever one best fits the shape of the object. Available options:
|
Center | Specify the center of the box relative to the transform position. |
Size | Specify the size of the box. This property is visible only when Shape is set to Box. |
Center | Specify the center of the capsule relative to the transform position. |
Radius | Specify the radius of the capsule. This property is visible only when Shape is set to Capsule. |
Height | Specify the height of the capsule. This property is visible only when Shape is set to Capsule. |
Carve | Allow the NavMesh Obstacle to create a hole in the NavMesh. When selected, the NavMesh obstacle carves a hole in the NavMesh and the following properties are available:
|