Hi!
I’m trying to remove a connection between nodes (circled in yellow) when two objects are diagonally opposite, image attached (green is tagged and unwalkable, red is walkable). It’s the diagonal line like what the user wants here - Diagonal connections in a simple Grid Graph - I have that connection and I’m trying to detect and remove it.
When I want to block off an area I drop an object on the map, use a new GUO for the bounds of that object, set the walkability and the tag type with a corresponding penalty. After that I might want to clear that specific node connection.
(GraphNode).ClearConnections doesn’t seem to do anything, but I’m probably doing something wrong?
If I use GridGraph.SetNodeConnection to set the connections to false it’ll remove them but only before a GUO is set on the space. Once a GUO is used to set walkability & tag, SetNodeConnection doesn’t remove them.
An example of what happens is I will remove the gameobject from the scene, use SetNodeConnections to delete the connection(s), I’ll see it flash with the connections removed for one frame and then they’re back.
I thought maybe it’s because I’m updating the connections manually, so I wrapped it up in a AStarWorkItem and the same outcome happens. Nothing in my code is rescanning the graph every frame.
Definitely appreciate any help if you have an idea as to what might be going on!
Thanks.