Dealing with the node size

Hi, I got a problem when I modified the node size to get my path looks nicer.


Basically, at point 2, the path goes through the middle of the node. However, there are two nodes at point 1. Thus, it will always choose the left node because the path is shorter. In this way, when I tried to make the path go through the middle of the gate, I had to increase the node size.
After I increasing the node size, the path at point 2 is blocked because the node is too big. Are there any solutions to solve this problem other than node size modification? like with the modifier?
Any help will be appreciated.

Hi

I’m afraid this is not easily solvable. The agents will see walking through the left side of the door as being a perfectly valid path, so they will pick it. Further, the pathfinding algorithm has to choose either the left or the right side because it can only calculate the path along node centers. If you reduce the node size a lot you can use erosion to create a thin path right in the middle of the door which would be closer to what you want. However, you would still see the same result with doors of other dimensions. Also you might not want to have to increase your graph resolution that much.

There is the ‘Radius’ modifier, but that will only add a fixed (small) offset to the path. It’s not a general solution.