AIPath and unwalkable terrain

I need to create some unwalkable terrain during gameplay. And, in doing so, I’ve discovered that all my characters are currently walking right through terrain that is considered unwalkable. And I don’t mean skirting the edges and cutting corners, but directly through the middle (in one case, right through a bench). Because of this behaviour, if I put a physical object and mark it obstacle, the characters will still plan to walk right through, and then get stuck because they hit an object and can’t proceed.

So, my question now, is what’s going on? Why does the AIPath not avoid unwalkable terrain? I have the simple smooth modifier on, but I’ve tried disabling it, and no difference. I’ve tried upping the re-path rate, and that doesn’t change anything. What am I missing?

Hi

When something is changed during runtime, the graphs need to be updated to account for this. The pathfinder does not work with actual scene data, that would be too slow. Instead it creates a representation of the scene (e.g a grid) which is much easier to perform pathfinding on. But when the scene is updated, the graph needs to be recalculated to account for the change.

See http://arongranberg.com/astar/docs/graph-updates.php

Yeah, but the odd thing is that they aren’t avoiding areas that are computed even before the game runs. I have a bench that is there from the start, and they walk/run right through it. That’s why I’m confused… I’m wondering if it has something to do with smoothing the path too much? Although, when some of the paths are shown on the graph, they are shown going around the unwalkable area, but the characters don’t follow it.

Oh, worked this morning. So nevermind. :slight_smile: