Creating and configuring an agent description from code - Nav3D Doc

Docy Child

Creating and configuring an agent description from code

All Nav3DAgentDescription parameters configured in the description inspector can also be configured from your code.

To do this, you need to create a variable of type Nav3DAgentDescription, then apply it to the agent. The correct way to create a description is to refer to the Nav3DAgentDescription.DefaultDescription property.

After setting the desired parameters in the code, you need to set the description instance to the agent.

If your description contains parameters whose value is configured to be randomly generated, then before setting the description, the agent needs to get a variant of the description with generated parameters. The correct way to get a description instance to set to an agent is to use the Nav3DAgentDescription.GetDescriptionVariant() method. Calling this method guarantees the creation of a separate instance of the description, taking into account the generated parameters. We recommend that you always use the GetDescriptionVariant() method to set the description for an agent via code.

					void ConfigureAgentDescription()
   Nav3DAgent myAgent = GetComponent<Nav3DAgent>();

   //create Nav3DAgentDescription instance with default parameters
   Nav3DAgentDescription myDescription = Nav3DAgentDescription.DefaultDescription;

   //set the parameters you want
   myDescription.Radius = 1.2f;
   myDescription.MotionNavigationType = MotionNavigationType.LOCAL;
   //apply the description to an agent

Agent log

In the second section, you can get the contents of the agent log by clicking on ...

Debug drawing

In the first section, you can visualize the agent and his nearest environment. T...

Creating and configuring an agent description from code

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


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


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


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


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 and its inheritors have an inspector that provides several useful...


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

Chat Icon Close Icon