GraphUpdateObject adds walkable border around obstacle

I’m using GraphUpdateObject to update the graph at runtime by calling AstarPath.active.UpdateGraphs. When placing a tree, I want to do a one-time update to A* to make nearby nodes unwalkable. This is actually working great, EXCEPT that A* is adding a walkable border around the non-walkable nodes. Adding a tree marks nearby nodes unwalkable. Adding another nearby tree will make its nearby nodes unwalkable, but also make all nodes just beyond that area walkable. I need a way to not mark the outer nodes walkable.

I the picture attached, I clicked four times to add four trees. Each tree added a large square “unwalkable” region. The last tree I placed was the top-right one. You can see how it actually made the unwalkable nodes from prior tree placements walkable.

Hi

Would you mind posting the exact code you are using?

Here’s the full code file: using GPUInstancer;using Pathfinding;using System.Collections;using System - Pastebin.com

Here’s the most relevant section from line 249:

Thank you for your time in looking into this – I really appreciate it.

Here’s a video as well:

Eagerly awaiting a resolution to this.

Note, these aren’t Game Objects or Terrain Trees. They’re being written directly to the GPU by GPU Instancer and A* is being adjusted programmatically, as shown in the code snippet.

I’m using the latest beta version of A*.

Hi

By default, a GUO will update the marked region as if the graph was scanned from scratch. You can disable this by setting guo.updatePhysics = false.

Brilliant! Thank you. Worked like a charm.

1 Like