Using Dynamic Obstacles and TagVolumes

Autodesk Navigation offers two different ways to handle the presence of dynamic and destructible obstacles in the World. Which approach you should use depends primarily on whether or not the obstacles are moving.

Obstacle classes

There are three possible classes that you can use to represent your obstacles:

TagVolumes

The TagVolume class represents a stationary physical obstacle or abstract zone whose extents are always integrated into the NavMesh.

Each TagVolume tags the area of the NavMesh it covers with a NavTag that you set up in the object initialization. This NavTag can be flagged as "exclusive," which marks the area as non-navigable—essentially punching a hole in the NavMesh. Alternatively, it can tag the area with a custom array of integer data values, which you can retrieve and handle during path finding, path following and queries. For details on the NavTag system, see Tagging with Custom Data.

For example, the TagVolume on the right has been flagged as exclusive. The one on the left has tagged the NavMesh with custom data; it is still walkable by default, but you can detect and respond to the NavTag during your path following.

Use this class directly to represent:

See Setting up TagVolumes.

CylinderObstacles

The CylinderObstacle class represents a moveable physical object whose dimensions are best expressed as a single cylinder.

By default, these objects are taken into account only by the dynamic avoidance system. However, when they become stationary, you can easily request them to integrate themselves into the NavMesh instead, which they do by transparently spawning an internal TagVolume.

For example, the orange cylinders on the left are moving, and taken into account only by dynamic avoidance. The other cylinders are stationary and integrated into the NavMesh: the cylinder on the grey area has a NavTag that is set as exclusive, and the cylinder on the green area has a NavTag with a custom data value.

Use this class to represent:

See Setting up CylinderObstacles.

BoxObstacles

The BoxObstacle class represents any moveable or free-rotating physical object with fixed extents and a box-shaped volume.

By default, these objects are taken into account only by the dynamic avoidance system. However, when they become stationary, you can easily request them to integrate themselves into the NavMesh instead, which they do by transparently spawning an internal TagVolume.

For example, the orange boxes on the left are moving and rotating freely, and thus taken into account only by dynamic avoidance. The other boxes are stationary and integrated into the NavMesh: the box on the grey area has a NavTag that is set as exclusive, and the box on the brown area has a NavTag with a custom data value.

Use this class to represent:

See Setting up BoxObstacles.

Dynamic NavMesh performance

Integrating TagVolumes into the NavMesh can be computationally intensive. The process is automatically time-sliced in order to avoid CPU peaks, but there is no guarantee that a new TagVolume will be integrated into the NavMesh immediately, or even within a given number of frames.

For best performance: