Right now I’m trying to figure out how exactly one is supposed to handle nodes in the gridgraph. I have a bridge prefab which I want to spawn after the game starts. Instead of just updating the grid, I want to create new grid nodes based on the position of some empties which I placed manually all over the bridge.
So I create the nodes like this :
and scan the graph.
and then I go through the list and set the node.position to the position of the empties. Then I set node.walkable to true on all of them and connect them via node.AddConnection() (in both directions) to the next nodes. I also connect the nodes at the end of the bridge to the normal grid nodes.
Now the grid looks just like I want it to, everything’s nicely connected. But when I calculate a path it completely ignores the additional changes, and if I scan the graph again the changes I made disappear.
What am I doing wrong here?