Simplest way to detect 'broken street path'

Ah sorry, it does work without delay too.

Hi

Calling UpdateGraphs like that will ask the grid graph to recalculate that region from scratch. It will completely override your node.Walkable = false line. You should not do both of those things.
Possibly what could be happening without delay is that your collider is still there and thus the UpdateGraphs function thinks that the node should still be walkable. Note that when destroying Unity GameObjects they are usually not actually destroyed until the end of the frame.

You were damn right! It was the collider thing!!!.

Solved:
Captura de pantalla 2021-04-21 a las 17.09.28

I apreciate a lot your support as always!!! I’ll keep recommending your Asset :slight_smile:

1 Like

Just one last question about how I’m doing this.
Isn’t it a bit ridiculous to create a grid with thousands of nodes for this case just to set them to walkable or not walkable?
Wouldn’t be more efficient to create or not create a node? You also told me something about Hierachy Grids but I don’t see how they can help me here.

You could use a PointGraph I suppose, but currently it’s not super easy to remove nodes from a point graph.
If your graph is not that large (128x128 is not terribly large) then I wouldn’t worry about it.

The HierarchicalGraph is just an internal data structure. It is what calculates the data that the IsPathPossible method uses. You would never use it directly.

1 Like

Thanks, thats what I wanted to hear but actually I have 3 graphs of 128x128, one for ships one for cars and one for planes… thats why im starting to get worried.

It will use a couple of megabytes of memory (maybe 5-10), but unless you find any performance issues I would go with this simpler solution.

1 Like

Very true. Thanks a lot!!!