I am trying to find the nearest node that has a certain tag. But it’s not getting anything. Let me know what I am doing wrong. Can I also specify that the node needs to be walkable ?
var constraint = new NNConstraint();
constraint.constrainTags = true;
constraint.tags = 1 << 1; // node should be tagged 1
var strainNodeInfo = AstarPath.active.GetNearest(_transform.position, strainConstraint);
if (strainNodeInfo.constrainedNode != null)
{
Debug.Log(“Found constrained node”);
}
Also, what is an area ? Is it a region of nodes all tagged the same or something else ? I didn’t quite understand how areas work.