NavAI Documentation
NavAI.NavigationZone

Inherits MonoBehaviour.

Classes

class  ObstacleList
 

Public Types

enum  EditorGenMode { EditorGenMode.Automatic, EditorGenMode.Manual }
 
enum  EditorUpMode { EditorUpMode.MeshAndAgents, EditorUpMode.MeshOnly, EditorUpMode.AgentsOnly, EditorUpMode.None }
 

Public Member Functions

Vector3 ClampPoint (Vector3 point)
 
bool ContainsCircle (Vector3 center, float radius)
 
bool ContainsPoint (Vector3 point)
 
Path FindPathImmediate (Vector3 start, Vector3 goal, float radius)
 
void GenerateMesh ()
 
void GenerateMesh (IList< Terrain > terrains, IList< GameObject > obstacles)
 
void GenerateMesh (Heightmap heightmap, IList< GameObject > obstacles)
 
void GenerateMesh (Heightmap heightmap, IList< IList< Vector2 >> obstacles)
 
void GenerateMesh (Heightmap heightmap, bool[,] tiles, IList< GameObject > obstacles)
 
void GenerateMesh (Heightmap heightmap, bool[,] tiles, IList< IList< Vector2 >> obstacles)
 
void GenerateMeshImmediate ()
 
void GenerateMeshImmediate (IList< Terrain > terrains, IList< GameObject > obstacles)
 
void GenerateMeshImmediate (Heightmap heightmap, IList< GameObject > obstacles)
 
void GenerateMeshImmediate (Heightmap heightmap, IList< IList< Vector2 >> obstacles)
 
void GenerateMeshImmediate (Heightmap heightmap, bool[,] tiles, IList< GameObject > obstacles)
 
void GenerateMeshImmediate (Heightmap heightmap, bool[,] tiles, IList< IList< Vector2 >> obstacles)
 
void GetAgentsInRange (Vector3 point, float searchRange, IList< Agent > result)
 
float GetHeight (Vector3 point)
 
Vector3 GetMeshPoint (Vector3 point, float radius)
 
void GetNearestAgent (Vector3 point, out Agent result)
 
void GetNearestAgents (Vector3 point, IList< KeyValuePair< float, Agent >> result, int maxNoAgents)
 
void GetNearestAgentsInRange (Vector3 point, float searchRange, IList< KeyValuePair< float, Agent >> result, int maxNoAgents)
 
void GetObstaclesInRange (Vector3 point, float radius, ObstacleCollection result, TriangulationWorker worker=null)
 
Vector3 GetSurfacePoint (Vector3 point)
 
Vector3 LocalToWorldPoint (Vector3 point)
 
Vector3 LocalToWorldVector (Vector3 vector)
 
bool QueryCollision (Vector3 point, float radius)
 
bool QueryMovement (Vector3 origin, Vector3 destination, float radius, TriangulationWorker worker=null)
 
bool QueryVisibility (Vector3 origin, Vector3 destination, TriangulationWorker worker=null)
 
void RecordEditorUndo ()
 
float SqrDistanceToPoint (Vector2 point)
 
Vector3 WorldToLocalPoint (Vector3 point)
 
Vector3 WorldToLocalVector (Vector3 vector)
 

Properties

int AgentCount [get]
 
Transform AgentHolder [get]
 
float AgentUpdateTime [get]
 
bool ArrangeAgents [get, set]
 
bool ArrangeObstacles [get, set]
 
bool ArrangeTerrain [get, set]
 
bool CalculateClearances [get, set]
 
bool CalculateHeights [get, set]
 
long CurrentSimulationStep [get]
 
EditorGenMode EditorGenerationMode [get, set]
 
EditorUpMode EditorUpdateMode [get, set]
 
float FrameTime [get]
 
int HeightmapResolution [get, set]
 
bool IsBakingMesh [get]
 
bool IsObstaclesTreeDirty [set]
 
bool IsReady [get]
 
bool IsStatic [get, set]
 
LayerMask Layers [get, set]
 
float MaxHeight [get, set]
 
float MaxSlope [get, set]
 
float MeshBakingProgress [get]
 
float MeshUpdateDelay [get, set]
 
float MeshUpdateTime [get]
 
int MeshVersion [get]
 
float MinClearance [get, set]
 
float MinPolygonArea [get, set]
 
float MinRegionArea [get, set]
 
int ObstacleCount [get]
 
Transform ObstHolder [get]
 
Vector3 Position [get, set]
 
float PositionUpdateTime [get]
 
float Precision [get, set]
 
bool RobustBaking [get, set]
 
float RvoUpdateTime [get]
 
bool ScanColliders [get, set]
 
bool ScanMeshes [get, set]
 
Vector3 Size [get, set]
 
float StepHeight [get, set]
 
int TilemapResolution [get, set]
 
float TimeStep [get]
 
int TreeObstaclesCount [get]
 
float TreeUpdateTime [get]
 
int TriangleCount [get]
 
int TriangulationObstaclesCount [get]
 
int VertexCount [get]
 
Settings ZoneSettings [get, set]
 

Detailed Description

A NavigationZone is a MonoBehaviour that defines a region with a navmesh where agents can navigate on.

A scene can have multiple NavigationZones active at the same time. In such cases, direct use of the NavigationZone's API is not recommended. Use the NavigationWorld static methods to handle scenes with multiple zones.

The NavigationZone contains internal structures of all the agents and obstacles on it, as well as the NavMesh used for navigation and pathfinding. The zone also contains worker classes used for multi-threaded pathfinding and collision avoidance, all of which are handled automatically during the zone's updates.

A NavigationZone can be set up using the editor inspector, or at runtime by adding a componenet to a GameObject. When creating a NavigationZone at runtime, be sure to set up all of the zone's variables and then calling the desired GenerateMesh method overload. GenerateMesh overloads with more parameters generate the mesh faster than overloads with less parameters. To ensure a quick runtime mesh generation, check out the AdvancedSettings/NavMesh section.

Member Enumeration Documentation

◆ EditorGenMode

Enum used to define the Editor Baking Mode.

Enumerator
Automatic 

The zone will automatically generate the mesh while in the editor.

Manual 

The zone will require manual mesh generation while in the editor.

◆ EditorUpMode

Enum used to define the Editor Update Mode.

This enum enables the ExecuteInEditMode attribute, enabling the NavigationZone to run the mesh and agents update while in the editor.

Enumerator
MeshAndAgents 

The NavMesh and the Agents will be updated while in the editor.

MeshOnly 

Only the NavMesh will be updated while in the editor.

AgentsOnly 

Only the agents will be updated while in the editor.

None 

Nothin will be updated while in the editor.

Member Function Documentation

◆ ClampPoint()

Vector3 NavAI.NavigationZone.ClampPoint ( Vector3  point)

Clamps the point to be within the zone volume.

Parameters
pointThe world point to be clamped.
Returns
A world point inside the zone volume.

◆ ContainsCircle()

bool NavAI.NavigationZone.ContainsCircle ( Vector3  center,
float  radius 
)

Returns true if the circle is partially or completely inside the zone boundaries.

Parameters
centerThe center of the circle in world space.
radiusThe circle radius in meters.
Returns
True if the zone area contains the circle.

◆ ContainsPoint()

bool NavAI.NavigationZone.ContainsPoint ( Vector3  point)

Returns true if the point is inside the zone boundaries.

Parameters
pointThe query world point
Returns
Ture if the zone volume contains the point.

◆ FindPathImmediate()

Path NavAI.NavigationZone.FindPathImmediate ( Vector3  start,
Vector3  goal,
float  radius 
)

Finds a path from start to goal.

Parameters
startThe path start point in world space.
goalThe path goal in world space.
radiusThe path collision radius in meters.
Returns
The path connecting the two points.

This process is not multi-threaded and may cause performance problems. Use of this meothd is not recommended.

The path will be available immediately after this method call. Be sure to check if the path found is not invalid.

◆ GenerateMesh() [1/6]

void NavAI.NavigationZone.GenerateMesh ( )

Generates a new mesh for the zone using a background process.

This overload will scan the entire scene for objects to be used on the mesh generation. This is the slowest overload for mesh generation and should be avoided when possible.

◆ GenerateMesh() [2/6]

void NavAI.NavigationZone.GenerateMesh ( IList< Terrain >  terrains,
IList< GameObject >  obstacles 
)

Generates a new mesh for the zone using a background thread.

Parameters
terrainsTerrains to be used.
obstaclesObstacles to be used.

This overload will skip the complete scene scan and jump right into the heightmap generation using the given terrain and obstacles.

The list of obstacles used in this overload should contain only static obstacles.

◆ GenerateMesh() [3/6]

void NavAI.NavigationZone.GenerateMesh ( Heightmap  heightmap,
IList< GameObject >  obstacles 
)

Generates a new mesh for the zone using a background process.

Parameters
heightmapThe heightmap to be used. Resolution must match the zone's heightmapResolution variable.
obstaclesThe list of obstacles to ve carved on the mesh.

remarks>

This overload will skip the terrain scan, and will use the given heightmap as a base. The obstacles will be carved on the heightmap and the generation process will continue from there.

The list of obstacles used in this overload should contain only static obstacles.

◆ GenerateMesh() [4/6]

void NavAI.NavigationZone.GenerateMesh ( Heightmap  heightmap,
IList< IList< Vector2 >>  obstacles 
)

Generates a new mesh for the zone using a background process.

Parameters
heightmapThe heightmap to be used. Resolution must match the zone's heightmapResolution variable.
obstaclesThe list of obstacles to ve carved on the mesh.

This overload will use the heightmap given and will jump right into the tilemap construction and then proceeed with the triangulation process.

The list of obstacles used in this overload should contain only static obstacles that carve on the triangulation.

◆ GenerateMesh() [5/6]

void NavAI.NavigationZone.GenerateMesh ( Heightmap  heightmap,
bool  tiles[,],
IList< GameObject >  obstacles 
)

Generates a new mesh for the zone using a background process.

Parameters
heightmapThe heightmap to be used. Resolution must match the zone's heightmapResolution variable.
tilesThe tiles to be used on the mesh. Must have the same resolution as the zone's tilemapResolution variable. True means the tile is occupied by an obstacle, false means the tile is free of obstacles and can be walked over.
obstaclesThe list of obstacles to be carved on the mehs baseTriangulation.

This overload uses the given heightmap and tilemap, and jumpts right into the triangulation process. This is a very fast generation process.

The list of obstacles used in this overload should contain only static obstacles that carve on the triangulation.

◆ GenerateMesh() [6/6]

void NavAI.NavigationZone.GenerateMesh ( Heightmap  heightmap,
bool  tiles[,],
IList< IList< Vector2 >>  obstacles 
)

Generates a new mesh for the zone using a background process.

Parameters
heightmapThe heightmap to be used. Resolution must match the zone's heightmapResolution variable.
tilesThe tiles to be used on the mesh. Must have the same resolution as the zone's tilemapResolution variable. True means the tile is occupied by an obstacle, false means the tile is free of obstacles and can be walked over.
obstaclesThe list of obstacles to be carved on the mehs baseTriangulation.

This overloada uses the given parameters and jumpts straight into the triangulation process. This is the fastest overload.

The list of obstacles used in this overload should contain only static obstacles that carve on the triangulation.

◆ GenerateMeshImmediate() [1/6]

void NavAI.NavigationZone.GenerateMeshImmediate ( )

Immediately generates a new mesh for the zone using the main thread.

This overload will scan the entire scene for objects to be used on the mesh generation. This is the slowest overload for mesh generation and should be avoided when possible.

◆ GenerateMeshImmediate() [2/6]

void NavAI.NavigationZone.GenerateMeshImmediate ( IList< Terrain >  terrains,
IList< GameObject >  obstacles 
)

Generates a new mesh for the zone using the main thread.

Parameters
terrainsTerrains to be used.
obstaclesObstacles to be used

This overload will skip the complete scene scan and jump right into the heightmap generation using the given terrain and obstacles.

The list of obstacles used in this overload should contain only static obstacles.

◆ GenerateMeshImmediate() [3/6]

void NavAI.NavigationZone.GenerateMeshImmediate ( Heightmap  heightmap,
IList< GameObject >  obstacles 
)

Immediately generates a new mesh for the zone using the main thread.

Parameters
heightmapThe heightmap to be used. Must have the same resolution as the zone's heightmapResolution variable.
obstaclesThe list of obstacles to be carved into the mesh.

This overload will skip the terrain scan, and will use the given heightmap as a base. The obstacles will be carved on the heightmap and the generation process will continue from there.

The list of obstacles used in this overload should contain only static obstacles.

◆ GenerateMeshImmediate() [4/6]

void NavAI.NavigationZone.GenerateMeshImmediate ( Heightmap  heightmap,
IList< IList< Vector2 >>  obstacles 
)

Immediately generates a new mesh for the zone using the main thread.

Parameters
heightmapThe heightmap to be used. Must have the same resolution as the zone's heightmapResolution variable.
obstaclesThe list of obstacles to be carved into the mesh.

This overload will use the heightmap given and will jump right into the tilemap construction and then proceeed with the triangulation process.

The list of obstacles used in this overload should contain only static obstacles that carve on the triangulation.

◆ GenerateMeshImmediate() [5/6]

void NavAI.NavigationZone.GenerateMeshImmediate ( Heightmap  heightmap,
bool  tiles[,],
IList< GameObject >  obstacles 
)

Immediately generates a new mesh for the zone.

Parameters
heightmapThe heightmap to be used. Must have the same resolution as the zone's heightmapResolution variable.
tilesThe tiles to be used on the mesh. Must have the same resolution as the zone's tilemapResolution variable. True means the tile is occupied by an obstacle, false means the tile is free of obstacles and can be walked over.
obstaclesThe list of obstacles to be carved on the mesh baseTriangulation.

This overload uses the given heightmap and tilemap, and jumpts right into the triangulation process. This is a very fast generation process.

The list of obstacles used in this overload should contain only static obstacles that carve on the triangulation.

◆ GenerateMeshImmediate() [6/6]

void NavAI.NavigationZone.GenerateMeshImmediate ( Heightmap  heightmap,
bool  tiles[,],
IList< IList< Vector2 >>  obstacles 
)

Immediately generates a new mesh for the zone.

Parameters
heightmapThe heightmap to be used. Must have the same resolution as the zone's heightmapResolution variable.
tilesThe tiles to be used on the mesh. Must have the same resolution as the zone's tilemapResolution variable. True means the tile is occupied by an obstacle, false means the tile is free of obstacles and can be walked over.
obstaclesThe list of obstacles to be carved on the mesh baseTriangulation.

This overloada uses the given parameters and jumpts straight into the triangulation process. This is the fastest overload.

The list of obstacles used in this overload should contain only static obstacles that carve on the triangulation.

◆ GetAgentsInRange()

void NavAI.NavigationZone.GetAgentsInRange ( Vector3  point,
float  searchRange,
IList< Agent result 
)

Locates and fills the list with all agents within range of the point.

Parameters
pointThe query point in world space.
searchRangeThe query search range in meters..
resultList to be filled with the result. Must not be a readyonly list.

Agent distances to the point are compared using the distance between the point and the agent collision radius.This means that agent size can affect the result.

◆ GetHeight()

float NavAI.NavigationZone.GetHeight ( Vector3  point)

Gets the heightmap height of the point.

Parameters
pointThe query point in world space.
Returns
The surface height of the point. Returns NaN if the zone does not contain the point or if there is no surface point under or above the point.

◆ GetMeshPoint()

Vector3 NavAI.NavigationZone.GetMeshPoint ( Vector3  point,
float  radius 
)

Returns the nearest collision-free point on the navigation mesh.

Parameters
pointThe query point in world space.
radiusThe query collision radius in meters.
Returns
The nearest collision-free point of the input point. Returns (NaN, NaN, NaN) if no collision-free mesh point was found for the given radius.

Result does not consider dynamic obstacles that are not carved into the mesh.

◆ GetNearestAgent()

void NavAI.NavigationZone.GetNearestAgent ( Vector3  point,
out Agent  result 
)

Fills the result with the nearest agent to the point.

Parameters
pointThe query point in world space.
resultThe query result.

Agent distances to the point are compared using the distance between the point and the agent collision radius.This means that agent size can affect the result.

◆ GetNearestAgents()

void NavAI.NavigationZone.GetNearestAgents ( Vector3  point,
IList< KeyValuePair< float, Agent >>  result,
int  maxNoAgents 
)

Fills the list with the n nearest agents of the point.

Parameters
pointThe query point in world space.
resultThe list to be filled with the agents. The Key is the distance from the agent to the point and the Value is the agent.
maxNoAgentsMaximum number of agents to fill the list with.

KEY = Vector2.Distance(agent, point) - agent.radius;

VALUE = agent;

Agent distances to the point are compared using the distance between the point and the agent collision radius.This means that agent size can affect the result.

◆ GetNearestAgentsInRange()

void NavAI.NavigationZone.GetNearestAgentsInRange ( Vector3  point,
float  searchRange,
IList< KeyValuePair< float, Agent >>  result,
int  maxNoAgents 
)

Fills the list with the n nearest agents of the point.

Parameters
pointThe query point in world space.
searchRangeThe query search range in meters.
resultThe list to be filled with the agents. The Key is the distance from the agent to the point and the Value is the agent.
maxNoAgentsMaximum number of agents to fill the list with.

KEY = Vector2.Distance(agent, point) - agent.radius;

VALUE = agent;

Agent distances to the point are compared using the distance between the point and the agent collision radius.This means that agent size can affect the result.

◆ GetObstaclesInRange()

void NavAI.NavigationZone.GetObstaclesInRange ( Vector3  point,
float  radius,
ObstacleCollection  result,
TriangulationWorker  worker = null 
)

Fills the list with all obstacles within range of the point.

Parameters
pointThe query point in world space.
radiusThe query search range in meters.
resultThe list to be filled with obstacles.
workerThe worker used internally by the query. This parameter cannot be null if called from outside the main thread.

This process includes triangulation edges that are considered obstacles as well as obstacles that are not carved on the triangulation. Since all obstacles implement IObstacle, use typechecks to get the type of obstacle stored in the list. SegmentObstalces are stored counter-clockwise, meaning the the obstacle is to the left of the segment.

Obstacles are added to the list using their bounding ball for quick searches. Be sure to check if the obstacle segments are actually within range of the point before doing operations with the obstacle.

◆ GetSurfacePoint()

Vector3 NavAI.NavigationZone.GetSurfacePoint ( Vector3  point)

Returns the Vector3(x, y, z) using the heightmap height.

Parameters
pointThe query point in world space.
Returns
A 3D world point whose y coordinate is the height of the point. The point y coordinate will be NaN if the zone does not contain the point or if there is no surface point under of above the point.

◆ LocalToWorldPoint()

Vector3 NavAI.NavigationZone.LocalToWorldPoint ( Vector3  point)

Transforms the local point into the global coordinate system.

Parameters
pointThe point to be transformed.
Returns
A point the the world coordinate system.

◆ LocalToWorldVector()

Vector3 NavAI.NavigationZone.LocalToWorldVector ( Vector3  vector)

Transforms the local vector into a world vector.

Parameters
vectorThe vector to be transformed.
Returns
A vector in the world coordinate system.

◆ QueryCollision()

bool NavAI.NavigationZone.QueryCollision ( Vector3  point,
float  radius 
)

Returns true if the point is in collision with the navigation mesh.

Parameters
pointThe query point in world space.
radiusThe query collision radius in meters.
Returns
True if the point is in collision with the navmesh.

Result does not consider dynamic obstacles that are not carved into the mesh.

◆ QueryMovement()

bool NavAI.NavigationZone.QueryMovement ( Vector3  origin,
Vector3  destination,
float  radius,
TriangulationWorker  worker = null 
)

Returns true if the circles are fully visible to each other.

Parameters
originThe query initial point in world space.
destinationThe query destination point in world space.
radiusThe query collision radius in meters.
workerThe worker used for this query. This parameter cannot be null if called from outisde the main thread.
Returns
True if the movement is possible for the given radius.

This method is equivalent to CapsuleCast, but it considers the navmesh triangles instead of object colliders. Only obstacles that are carved on the triangulation are considered for this query.

◆ QueryVisibility()

bool NavAI.NavigationZone.QueryVisibility ( Vector3  origin,
Vector3  destination,
TriangulationWorker  worker = null 
)

Returns true if the points are visible to each other.

Parameters
originThe query initial point in world space.
destinationThe query destination point in world space.
workerThe worker used for the query. This parameter cannot be null if called from outside the main thread.
Returns
True if the points are visible to one another.

This method is equivalent to Unity's Physics.Raycast, but it considers the navmesh triangles instead of object colliders. Only obstacles that are carved on the triangulation are considered for this query.

◆ RecordEditorUndo()

void NavAI.NavigationZone.RecordEditorUndo ( )

Records the object undo for editor operations.

This method is used internally in the editor scripts. There is no need for the user to call this.

◆ SqrDistanceToPoint()

float NavAI.NavigationZone.SqrDistanceToPoint ( Vector2  point)

Returns the square distance between this zone and the point.

Parameters
pointThe query point in world space.
Returns
The distance squared between this zone and the point. Zero if the zone contains the point.

This is a 2D operation and does not consider the point height (y coordinate).

◆ WorldToLocalPoint()

Vector3 NavAI.NavigationZone.WorldToLocalPoint ( Vector3  point)

Transforms the world point to a point in the zone's local coordinate system.

Parameters
pointThe point to be transformed.
Returns
A point in the zone local coordinate system.

◆ WorldToLocalVector()

Vector3 NavAI.NavigationZone.WorldToLocalVector ( Vector3  vector)

Transforms the world vector into a zone local vector.

Parameters
vectorVector to be transformed.
Returns
A vector in the zone coordinate system.

Property Documentation

◆ AgentCount

int NavAI.NavigationZone.AgentCount
get

Gets the number of acitve agents on the zone.

◆ AgentHolder

Transform NavAI.NavigationZone.AgentHolder
get

◆ AgentUpdateTime

float NavAI.NavigationZone.AgentUpdateTime
get

Gets the total processing time of the agents tree update for the previous simulation step.

◆ ArrangeAgents

bool NavAI.NavigationZone.ArrangeAgents
getset

Gets or sets the zone arrange agents option.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ ArrangeObstacles

bool NavAI.NavigationZone.ArrangeObstacles
getset

Gets or sets the zone arrange obstacles option.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ ArrangeTerrain

bool NavAI.NavigationZone.ArrangeTerrain
getset

Gets or sets the zone arrange terrain option.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ CalculateClearances

bool NavAI.NavigationZone.CalculateClearances
getset

Gets or sets the zone calculate clearances option.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ CalculateHeights

bool NavAI.NavigationZone.CalculateHeights
getset

Gets or sets the zone calculate heights.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ CurrentSimulationStep

long NavAI.NavigationZone.CurrentSimulationStep
get

Gets the current simulation step of the zone.

This is the number of steps the zone has performed since it started. It may differ from the number of frames ran on the application both because the Zone may use a different update frequency than the application framerate, but also because it can take a while for the zone to become active after application initilization.

◆ EditorGenerationMode

EditorGenMode NavAI.NavigationZone.EditorGenerationMode
getset

Gets or sets the zone editor bake mode.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ EditorUpdateMode

EditorUpMode NavAI.NavigationZone.EditorUpdateMode
getset

Gets or sets the zone editor update mode.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ FrameTime

float NavAI.NavigationZone.FrameTime
get

Gets the total processing time of the previous simulation step for this zone.

◆ HeightmapResolution

int NavAI.NavigationZone.HeightmapResolution
getset

Gets or sets the zone heightmap resolution.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ IsBakingMesh

bool NavAI.NavigationZone.IsBakingMesh
get

Gets true if the zone is currently baking a new navmesh.

◆ IsObstaclesTreeDirty

bool NavAI.NavigationZone.IsObstaclesTreeDirty
set

Gets or sets if the obstacles tree is dirty.

A dirty obstacles tree will update on the next simulation step. The zone's obstacles tree automatically becomes dirty whenever an obstacle is added or an obstacle has changed.

◆ IsReady

bool NavAI.NavigationZone.IsReady
get

Gets true if the zone is ready for use.

The zone is ready for use if it's mesh is not null and is ready.

◆ IsStatic

bool NavAI.NavigationZone.IsStatic
getset

Gets or sets if the zone is static.

A static zone will not be able to have it's transform changed at runtime. Despite being static or not, the zone's navmesh and obstacles will still be dynamic and the triangulation will still update as needed.

◆ Layers

LayerMask NavAI.NavigationZone.Layers
getset

Gets or sets the zone layermask.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ MaxHeight

float NavAI.NavigationZone.MaxHeight
getset

Gets or sets the zone max height in meters.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ MaxSlope

float NavAI.NavigationZone.MaxSlope
getset

Gets or sets the zone max slope in degrees.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ MeshBakingProgress

float NavAI.NavigationZone.MeshBakingProgress
get

Gets the progress percentage of the baking process. If the zone is not baking a mesh, the return value will be 0.

Be sure to check if the zone is baking a mesh befrore using this value.

◆ MeshUpdateDelay

float NavAI.NavigationZone.MeshUpdateDelay
getset

Gets the total background processing time for the previous triangulation update.

◆ MeshUpdateTime

float NavAI.NavigationZone.MeshUpdateTime
get

Gets the total processing time of the mesh update for the previous simulation step.

◆ MeshVersion

int NavAI.NavigationZone.MeshVersion
get

Gets the zone's NavMesh version.

The NavMesh version starts at 0 and is incremented by one every time it updates.

◆ MinClearance

float NavAI.NavigationZone.MinClearance
getset

Gets or sets the zone minimum clearance in meters.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ MinPolygonArea

float NavAI.NavigationZone.MinPolygonArea
getset

Gets or sets the zone minimum polygon area in meters squared.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ MinRegionArea

float NavAI.NavigationZone.MinRegionArea
getset

Gets or sets the zone minimum region area in meters squared.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ ObstacleCount

int NavAI.NavigationZone.ObstacleCount
get

Gets the number of active obstacles on the zone.

This number includes both obstacles that are carved on the triangulation and obstacles that are not.

◆ ObstHolder

Transform NavAI.NavigationZone.ObstHolder
get

◆ Position

Vector3 NavAI.NavigationZone.Position
getset

Gets or sets the zone position in the world.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ PositionUpdateTime

float NavAI.NavigationZone.PositionUpdateTime
get

Gets the total processing time of the transform updates for the previous simulation step.

◆ Precision

float NavAI.NavigationZone.Precision
getset

Gets or sets the zone precision in meters.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ RobustBaking

bool NavAI.NavigationZone.RobustBaking
getset

Gets or sets the zone robust baking option.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ RvoUpdateTime

float NavAI.NavigationZone.RvoUpdateTime
get

Gets the total processing time of the RVO update for the previous simulation step.

◆ ScanColliders

bool NavAI.NavigationZone.ScanColliders
getset

Gets or sets the zone scan colliders option.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ ScanMeshes

bool NavAI.NavigationZone.ScanMeshes
getset

Gets or sets the zone scan meshes.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ Size

Vector3 NavAI.NavigationZone.Size
getset

Gets or sets the zone world size.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ StepHeight

float NavAI.NavigationZone.StepHeight
getset

Gets or sets the zone step height in meters.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ TilemapResolution

int NavAI.NavigationZone.TilemapResolution
getset

Gets or sets the zone tilemap resolution.

This propriety cannot be set at runtime after the zone becomes ready.

Check the AdvancedSettings/NavMesh for more information on this zone propriety.

◆ TimeStep

float NavAI.NavigationZone.TimeStep
get

Gets the timestep of the last simulation step.

This number will be constant if the simulation uses fixed update.

◆ TreeObstaclesCount

int NavAI.NavigationZone.TreeObstaclesCount
get

Gets the number of active obstacles on the zone's obstacle tree.

This number does not include obstacles that are carved on the triangulation.

◆ TreeUpdateTime

float NavAI.NavigationZone.TreeUpdateTime
get

Gets the total processing time of the obstacles tree update for the previous simulation step.

◆ TriangleCount

int NavAI.NavigationZone.TriangleCount
get

Gets the number of triangles on the zone's triangulation.

This number includes both walkable and unwalkable triangles.

◆ TriangulationObstaclesCount

int NavAI.NavigationZone.TriangulationObstaclesCount
get

Gets the number of active obstacles on the zone's triangulation.

This number does not include obstacles that are not carved on the triangulation.

◆ VertexCount

int NavAI.NavigationZone.VertexCount
get

Gets the number of vertices on the zone's triangulation.

This number includes vertices of both walkable and unwalkable triangles.

◆ ZoneSettings

Settings NavAI.NavigationZone.ZoneSettings
getset

Gets or sets the zone settings file.

The zone settings file is used for all agents and obstacles assigned to the zone.