Enclosed areas and tags

Hey Aron,

Just trying to figure out what I’m doing wrong again. I have a scenario where players can build fences in a circle and can completely close off an entire area of terrain with a fence (so nothing should get inside the area). If I update the fences bounds’ area (using a graph update scene component) to modify the node tags underneath the fences to be a different tag, my agents will not path at all. I’m using “closest on node” for the seeker (both start and end points).

However, if I update my fences nodes to modify the walkability of the nodes (i.e. set the nodes unwalkable), then my agents WILL path, and properly find the closest node to the end position.

My problem is I would like to use tags and not have to modify the walkability, so that I can have some agents walk over those nodes, but not others. But the tags don’t seem to be working right now.

Any ideas on why this might be?

Thank you.

Hi

This is because when using tags, the system does not know that the inside is not reachable. So it will try to search for a path to the inside of those fences, but the path will fail because there is no such path.

You can enable the calculatePartial field on the path object to calculate a partial path in case the regular path fails.
See http://arongranberg.com/astar/docs/class_pathfinding_1_1_a_b_path.php#adb241127befc08aa01a5696f071e8c93

1 Like