Nav3DObstacleLoader - Nav3D Doc

Docy Child

Nav3DObstacleLoader

To use the possibility of pre-baking obstacles on the scene in editor mode and then loading them from a binary file, the Nav3DObstacleLoader component is used. You can create it on the scene using the following top menu button:

 

The following game object will appear on the scene:

 

For all obstacles in the scene that you want to bake, select the “Load from binary” processing mode.

 

Next, in the Nav3DObstacleLoader component inspector, you can see a list of all game objects with the Nav3DObstacle component that are subject to baking.

 

Click the “Bake and serialize obstacles” button and select a folder in the project to save a binary file with baked data about obstacles on the scene.

After successful baking, the Nav3DObstacleLoader component inspector will look like this:

 

The inspector of successfully serialized Nav3DObstacle will look like this:

Now in game mode, when Nav3D is initialized, the navigation graphs of all baked obstacles on the scene will be loaded from a binary file.

*There is an important note regarding game objects for which static batching is enabled. When loading the navigation graph from a binary file, Nav3DObstacleLoader tries to check the correspondence of the data in the binary file and the current parameters of the obstacle on the scene (the structure of the transform hierarchy, the transform component fields, the presence of a valid mesh in the MeshFilter, and so on). This check is needed to throw an exception and thereby notify the user that the baked navigation file has become obsolete, since the obstacle was changed after saving the binary file. If static batching is enabled for a group of obstacles, validation will never be successful because the obstacle mesh cannot be accessed. So we added the option to disable validation. To do this, uncheck “Validate serialized data” in the Nav3DObstacleLoader inspector.

Nav3DSphereShell

Represents a spherical shell that is perceived by other agents as an object to a...

Nav3DEvader

There is also a separate controller, whose behavior consists of just avoiding ne...

Nav3DAgentManager

This class implements several methods to get a list of all Nav3DAgents located i...

Nav3DPathTester

We implemented a useful component (Nav3DPathTester), which can be used while bui...

PathfindingResult

Contains the pathfinding data and time statistics. Time statistics: public TimeS...

Nav3DPath: Events

For the convenience of notification when the pathfinding finished, the following...

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 a config via code

All Nav3DAgentConfig parameters can be configured through the code as well. To ...

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...

Chat Icon Close Icon
en_USEnglish