2D Set Tag Problem

  • A* version: 4.2.17
  • Unity version: 2021.3.33f1

I’m using A* for the pathfinding of some enemies. The problem I 'm facing is that the enemy has a wall on his left side, then I want him to take the path of his right, the path of the right side is longer but he must take it.

I’m trying to make the wall of is left as Traversable false. I use GraphUpdateScene to update the tag of the nodes inside the wall. The problem is that this doest works, and this area keep having the tag 0 (ground tag) instead the tag 1 (the wall tag).

Here I give some screenshots of my configuration:

image

image

image

Thanks for your help.

Hi

Check that the collider’s z coordinate is close enough to the graph’s z coordinate. E.g. if the graph is on the XY plane (z=0), then the collider must be somewhat close to that as well (within 1 unit). Otherwise the bounding box will not actually contain the nodes.

1 Like

That works.

Thanks!