So I’ve run into a weird issue. I have a GraphUpdateScene on a component. If an interaction happens on that component, I update its GraphUpdateScene to have WalkabilityValue = true. After I have set this, I call AstarPath.Active.UpdateGraphs(myGameObjectsBounds);. Unfortunately, this does not update correctly. If I call AstarPath.active.Scan() it does update correctly, but this is both expensive and not possible in my situation because I have some layers hidden that then get missed out in this scan.
With WalkabilityValue = true you will mark all nodes inside the bounding box as walkable.
Maybe instead you want to set guo.modifyWalkability=false, and guo.updatePhysics = true. This will make it behave as if you recalculated that part of the graph from scratch (like Scan()).
Setting updatePhysics = true makes no sense when also setting modifyWalkability. Then you will just recalculate the nodes from scratch, only to replace all their walkability values with true.
Make sure that your bounding box covers the nodes even on the Y axis.
I expand the bounds to ensure I hit the nodes. This still does not update the nodes as expected.
For reference, after my code has run, if I go to my pathing component and hit scan, it does calculate correctly, as can be seen here:
Is there a functional difference between Scan() and UpdateGraph()? In my GraphUpdateScene on my door I have ApplyOnScan = true, is that picked up in the UpdateGraph()?
Yes, a GraphUpdateScene with ApplyOnScan will not be executed during a graph update. A GraphUpdateScene itself is just a graph update.
If you want to apply a graph update scene during runtime you can call the Apply method on it. See GraphUpdateScene - A* Pathfinding Project