GridGraph not correctly connecting on terrain seam

I have multiple large terrains and a LayerGridGraph. The graph fails to connect grid nodes on the seam of the terrains. How can I fix this?


Is this 2 grid graphs or a single one?
I would strongly recommend using a single graph for the whole world, not multiple ones.

Hey aron,

Its a single LayerGridGraph updated by the procedural mover. I made some tweaks to the mover script to support the layered version. It works great everywhere but where two terrain tiles meet which is odd. What would cause this?

Hm… Weird.
Does it work if you scan the graph in the inspector while over that seam (i.e not using the procedural grid mover)?

It works when scanning in the inspector. Is there some code I am not calling that is necessary?

Ok. So presumably there is something in your procedural grid mover code that is not working right. Maybe it doesn’t take care of the edges of the graph correctly or something?

I’m confused why the edges of the terrain colliders would be treated as an edge since they are generating at runtime. It works fine everywhere else. I’ll try the unmodified GridLayer with procedural mover to see if that works since its based on the same code.

I mean the edge of the graph, not the edge of the terrain.

Yes but its not failing on the edge of the graph :slight_smile:

Your version of the mover with GridGraph works. There must be an error in my implementation. I outlined my changes in this post: Can LayerGridGraph work with ProceduralGridMover?

Is there any obvious errors in this approach? Would you be willing to help debug? I would be happy to send code if it would mean this feature would be added to the project.

Moved around the world a bit. It doesn’t always fail, sometimes it does manage to connect the nodes… Confused.

Here’s a screen shot of its behavior. Sometimes it connects, most times it does not. I turned off one terrain tile after generation to clearly show where the seam is.


I took some time to (finally) write a procedural grid graph mover that works for layered grid graphs as well.
If you PM me I can send you a preview version.