Class NavMeshLink
Component used to create a navigable link between two NavMesh locations.
Namespace: Unity.AI.Navigation
Syntax
public class NavMeshLink : MonoBehaviour
Properties
agentTypeID
Gets or sets the type of agent that can use the link.
Declaration
public int agentTypeID { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
area
The area type of the link.
Declaration
public int area { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
autoUpdate
Gets or sets whether the world positions of the link's edges update whenever the GameObject transform changes at runtime.
Declaration
public bool autoUpdate { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
bidirectional
Gets or sets whether the link can be traversed in both directions.
Declaration
public bool bidirectional { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
costModifier
Gets or sets a value that determines the cost of traversing the link.
Declaration
public int costModifier { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
A negative value implies that the traversal cost is obtained based on the area type. A positive or zero value applies immediately, overridding the cost associated with the area type.
endPoint
Gets or sets the position at the middle of the link's end edge.
Declaration
public Vector3 endPoint { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
The position is relative to the GameObject transform.
startPoint
Gets or sets the position at the middle of the link's start edge.
Declaration
public Vector3 startPoint { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
The position is relative to the GameObject transform.
width
The width of the segments making up the ends of the link.
Declaration
public float width { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
The segments are created perpendicular to the line from start to end.
Methods
UpdateLink()
Replaces the link with a new one using the current settings.
Declaration
public void UpdateLink()