Overlapping GraphUpdateScenes => inconsistency

  • A* version: 5.3.3
  • Unity version: 6000.0.36f1

When I have two overlapping — or just adjacent — GraphUpdateScene objects, I get inconsistent results on re-scanning the graph. It’s as if they alternate their influence and break the other object around the edges. Here are some screenshots of the setup and results: :point_down:
(this is all scanning in editor)

As you can see, on each scan, a different grid node is set as walkable/not walkable :point_down:
(this alternates on each Scan)

:point_down: Below is the setup on the GraphUpdateScene component.
(These objects have trigger BoxColliders that are not included in the graph scanning)

Screenshot 2025-03-21 at 10.59.31

Is there a way to fix this?

AN ALTERNATE SOLUTION: SCAN FOR TRIGGERS

If I could make the GridGraph scan include triggers, I would not need the GraphUpdateScene objects! I could just put these trigger volumes on the ‘Obstacles’ layers in the GridGraph, which seems intuitive and easy as well!

But since the GridGraph obstacle scan doesn’t include triggers, I need the GraphUpdateScene…

Turning off Update Physics fixed this behavior on my end. If that’s not required you can turn that off and you should be good :+1:

I am not 100% sure of the intention of that setting in general or in this use case though :thinking: if it’s something you need for your project let me know and I’ll tag Aron on this to review if it’s possibly a bug or just something I’m not understanding.

Thanks so much!

That did help.

I am running into another variation of the problem now, though :face_holding_back_tears:

When I create a Dynamic Obstacle at runtime, the neighboring cells have their tags cleared!

The tag is applied by a GraphUpdateScene component: :point_down:

I’m in a thread working on something semi-related so my first thought is, as a test, trying shrinking the collider and see if it still happens? If that fixes it you may want to consider using the list of points. If not let me know!

1 Like

Heyy! Thanks!

Shrink which collider? Of the DynamicObstacle or of the GraphUpdateScene that changes the tag?

How does DynamicObstacle work actually? Does it just use bounds of any Collider attached to the same object?

Of the DynamicObstacle :smiley: I’m mainly wondering if this happens if neighboring nodes are being caught in the update… but then why would that be clearing thier tag specifically :thinking: Time to open Unity and investigate :slight_smile:

Yeah it grabs the bounds from the collider. Just looked through the code and it’s pretty much just the bounds of the collider from what I’m reading. (As well as the bounds of where it was before to rescan and restore those nodes)

1) Shrinking Collider

So I shrunk the collider, tho it was already MUCH smaller than a single grid cell…

It didn’t have an effect.

2) Non-Trigger Collider

So I’m getting a little closer to a workaround/solution.

Turning off “IsTrigger” on the GraphUpdateScene’s collider fixes the update (preserves tags).:partying_face:
I toggled “IsTrigger” DURING playing.

But then, for this to also work when starting the game (and the initial scan):

  • the collider’s layer must be included in the scan
  • the collider must not be a Trigger.

=> Which then causes the grid to be ON TOP of the GraphUpdateScene collider:

:thinking:

Screenshot 2025-04-18 at 09.00.38

It’s kind of weird that GraphUpdateScene works at “initial scan” with a Trigger collider, but when updating the graph it no longer works with a Trigger collider?

EDIT: Actually, nevermind this. I can’t find a combination of these settings at edit or play time that will leave the tags alone without putting the grid on top of the marker collider.

(But I am not familiar with the flow of GraphUpdateScene / DynamicObstacle is… Does a DynamicObstacle trigger a complete re-scan? Are GraphUpdateScenes supposed to re-apply their properties after that? Or is DynamicObstacle actually supposed to leave the tags alone ?)

3) Using Points

So I tried using the points array instead of a collider (which is much less convenient for editing in this scenario, but that aside).

Unfortunately the behaviour is the same:

So, verdict: I’m stuck! I tried every combination of settings I could think of! I tried toggling IsTrigger after scanning the grid at runtime, etc. But nothing gives me the desired behavior of just leaving the tags alone! :joy: