Agent ignoring pathfinding modifier cost

Hey, so. I’m back at it again, and yes, I’m still having trouble with pathfinding. Anyways, to the point.

I have multiple pathfinding modifiers with the label “NonTraversableArea”, and the cost of it has been set to math.huge. Each non-traversable area is simply an invisible part with collisions disabled.

Even though the cost for pathfinding through it is infinity, it still walks through it? I’ve attempted setting it to a high number such as 1000, too, which didn’t work either.

Could it have to do with it not finding any other path? If so, that would be incredibly strange, as the NPCs could easily just walk around the areas.

All sort of help is appreciated, thanks :slight_smile:

A workaround for this would be to set the area parts’ CanCollide to true, but I would have to work with collision groups to make sure players can’t collide with them.

While the workaround would work perfectly fine, it’s incredibly strange how it pathfinds through the zone, even though the cost to walk through it is infinite.

You could use collision groups?

1 Like

You can set the PassThrough Property of the PathfindingModifier to true.

1 Like

Yeah, that’s what I ended up doing.

1 Like