Obstacle combinations - Nav3D Doc

Docy Child

Obstacle combinations

We will call obstacles with the selected processing mode “Runtime” as runtime obstacles, and those with the “Load from binary” mode as static obstacles.

If you create a runtime obstacle during game mode, it will be processed and added to the storage (when OnEnable() is triggered). If you disable an already processed runtime obstacle on the scene, it will be removed from the storage (when OnDisable() is triggered).

Static obstacles are meant to be static in the sense that they cannot be added or removed in playmode. They will be present in the scene from the moment they are loaded from the file until Nav3D is deinitialized.

Since the above operations of adding and removing for a specific obstacle can affect the volumes of other obstacles on the scene, a conflict arises between static and runtime obstacles if their volumes intersect in space.

So we decided to introduce a few restrictions:

  • At the time of initialization, all static obstacles are first loaded and added, only then runtime obstacles are processed and added (if there are any on the scene).
  • When processing and adding a runtime obstacle, its volume must not intersect the volumes of static obstacles, otherwise an IntersectStaticObstacleException will be thrown.
  • As mentioned above, adding several runtime obstacles can lead to the fact that a combined volume will be formed for them that is larger than each of their volumes separately. Your task is to ensure that the possible combined volume does not intersect the volumes of static obstacles. To check for such a potential collision there is a method Nav3DManager.BoundsCrossStaticObstacles(Bounds _Bounds).

To avoid such situations, we suggest that you completely avoid using static and runtime obstacles together on the same scene.

If you still decide to use both types, we recommend creating runtime obstacles far from static obstacles in order to minimize the likelihood of volumes intersecting.

Agent log

Here you can copy the contents of the agent log to the clipboard by clicking the...

Debug drawing

In this section, you can visualize the agent and his nearest environment. This s...

Creating and configuring an agent description from code

All Nav3DAgentDescription parameters configured in the description inspector c...

Nav3DManager

Nav3DManager is a helper static class. Can be useful for checking whether Nav3D ...

Nav3DInitializer

To use Nav3D in playmode, you need to initialize it. The Nav3DInitializer compon...

Nav3DObstacleLoader

To use the possibility of pre-baking obstacles on the scene in editor mode and t...

Nav3DObstacle

To manage obstacles on the scene, the Nav3DObstacle component is designed. Attac...

Obstacle combinations

We will call obstacles with the selected processing mode “Runtime” as runtim...

Operations with obstacles

Regardless of the obstacle processing mode, the processing procedure consists of...

Deeper dive into obstacles

As already described above, in order for an obstacle to be taken into account du...

Nav3DAgent : Debug

The Nav3DAgent has an inspector that provides several useful functions to help w...

Nav3DAgent

As mentioned above, you can use the Nav3DAgent script as a component for your ga...

Chat Icon Close Icon
en_USEnglish