Graphs that this agent can use.
This field determines which graphs will be considered when searching for the start and end nodes of a path. It is useful in numerous situations, for example if you want to make one graph for small units and one graph for large units, or one graph for people and one graph for ships.
This is a bitmask so if you for example want to make the agent only use graph index 3 then you can set this to: settings.graphMask = GraphMask.FromGraphIndex(3);
Note that this field only stores which graph indices that are allowed. This means that if the graphs change their ordering then this mask may no longer be correct.
If you know the name of the graph you can use the Pathfinding.GraphMask.FromGraphName method: GraphMask mask1 = GraphMask.FromGraphName("My Grid Graph");
GraphMask mask2 = GraphMask.FromGraphName("My Other Grid Graph");
NearestNodeConstraint nn = NearestNodeConstraint.Walkable;
nn.graphMask = mask1 | mask2;
// Find the node closest to somePoint which is either in 'My Grid Graph' OR in 'My Other Grid Graph'
var info = AstarPath.active.GetNearest(somePoint, nn);
float[]
tagCostMultipliers
Multiplier for the cost of moving some distance across a node with a given tag.
This will be multiplied by the traversed distance in millimeters (see Int3.Precision) to get the final cost. The default value is 1, which means that the cost will be the same as the distance. If you set this to 2, the cost will be twice as high as the distance.
For example, moving 1 world unit across a node with tag 0 will cost 1000 * tagCostMultipliers[0] units of movement cost.
If null (the default), all tags will be treated as having a multiplier of 1.
NotePrefer to make tags more costly (cost multiplier >1), rather than making them cheaper than the default (cost multiplier <1). If you set any cost multiplier to less than 1, you'll also need to reduce AstarPath.heuristicScale to the lowest cost multiplier that you use in the project, otherwise the pathfinding algorithm may not find the optimal path. Alternatively you could compensate with a higher tagEntryCosts value, so that the agent can never move to the target with a lower cost than the default. See https://en.wikipedia.org/wiki/Admissible_heuristic.
This array must be of length 32.
In the inspector, this value is displayed as "Cost per world unit", and is shown as multiplied by 1000 ( Int3.Precision), to make it the cost per world unit. While in code, it is a multiplier of the default cost.

var traversalCosts = new TraversalCosts();
// Make tags 1 and 4 have a higher penalty
var tagCostMultipliers = new float[32];
tagCostMultipliers[1] = 2.5f;
tagCostMultipliers[4] = 5.0f;
traversalCosts.tagCostMultipliers = tagCostMultipliers;
var path = ABPath.Construct(Vector3.zero, Vector3.one);
path.traversalCosts = traversalCosts;
uint[]
tagEntryCosts
How much it costs to enter a node with a given tag.
This can be used to make agents avoid, or prefer, nodes with certain tags.
For example, every time a path enters tag 0 (which is the default tag), it will cost an extra tagEntryCosts[0].
For most pathfinding purposes, you can think of this as just the additional cost of traversing a node with the given tag. The distinction between entering and exiting a node is a very small one, and will not make a difference in most cases.
The index in the array corresponds to the tag. All entry costs are positive values since the A* algorithm cannot handle negative costs.
If null (the default), all tags will be treated as having an entry cost of zero. However, the path will still receive cost from the tagCostMultipliers field.
This cost will be applied for every node that is entered, regardless of if the previous node had the same tag or not.
NoteThis array must be of length 32.
var traversalCosts = new TraversalCosts();
// Make tags 1 and 4 have a higher penalty
var tagEntryCosts = new uint[32];
tagEntryCosts[1] = 1000;
tagEntryCosts[4] = 20000;
traversalCosts.tagEntryCosts = tagEntryCosts;
var path = ABPath.Construct(Vector3.zero, Vector3.one);
path.traversalCosts = traversalCosts;
In the Seeker and FollowerEntity inspectors, this field (called "Cost per node") is hidden if your scene only contains navmesh/recast graphs, since using per-node costs on those graphs is not recommended due to the significant differences in node sizes and shapes that they have. Use tagCostMultipliers instead.
