Tagging Objects to Determine Walkability/Penalty on RecastGraph

Hi, I’m fairly new to the pathfinding project and I have a question concerning the tagging system used. Unity objects have a tagging system, but it looks like the Seeker script relies on a tagging system of its own that assigns tags to nodes, not objects. I’m trying to have pedestrians stay on the sidewalk object I have and avoid the street by placing a weight to the street object itself.
Is there a way to apply these tags to objects so that an entire object can have some weight and tag set to it? I don’t want to manually create areas with the Graph Update Scene script so if the first option isn’t possible, would I just have to come up with an algorithm to apply tags and weights at the beginning?
Thanks!

Bump! Anyone? Anyone?
As an update, I did realize that with a Recast, walkability isn’t an issue because nodes that aren’t walkable wouldn’t be part of the recastgraph in the first place. However, there’s got to be some way of adding penalties to parts of a recast graph. A whole month has passed since I asked and the forum doesn’t seem /that/ dead, so… anyone have an idea?

Hi

Sorry for the late answer. I upgraded the forum to discourse, and even though it is nice in many ways, there is no good way to keep track of which threads have been answered and which have not.

Sorry, there is no out automatic way to do that right now (I really should add one).
You can use the GraphUpdateScene script or maybe you could do something like

AstarPath.active.RegisterSafeUpdate (() => {
    AstarPath.active.astarData.recastGraph.GetNodes ((node) => {
        node.Tag = // Do something with raycasts to figure out what the tag should be
        return true;
    });
});

Oh, I see, so one option could be to tag all the nodes based on what object/terrain they’re on. I think this is the solution I need! Thanks!

2 Likes