Enabling / Disabling individual connections within a grid node

Is there a way to do this? I tried using SetConnectionInternal but it wasn’t behaving as expected. Should I be using something else?

I’m trying to get agents to enter an area via a doorway, which sometimes could be on a corner. In that particular scenario I would only want them to travel vertically on that tile, and not horizontally. Here is an image of the specific problem:

Any ideas / advice?

Thanks a bunch! :slight_smile:

-Rebecca

Hi

You should know that your walls are right now placed right between two nodes, they should be placed so that they go through node centers. The red cubes are unwalkable nodes.

That configuration of nodes
`


X
X__
_____`
is explicitly hard coded not to create a connection because in 99% of the cases, it will be a connection through a wall or something.
I really think you should decrease the node size of your grid graph, that looks very low resolution for what you want to achieve.

Calling SetConnectionInternal on both nodes with the correct indices and then after that calling
AstarPath.active.FloodFill should do the trick as well.