Layer Grid Graph - how to add layers?

Hi,

I might have missed the right documentation for the Layer Grid Graph, but I’m having problems understanding it. I just read LayerGridGraph - A* Pathfinding Project and looked at the API a bit.

Is the layer count computed automatically based on the scanned terrain? I can’t find a way to set it, LayerCount is a getter only and AddLayers is private.

I have a minecraft like terrain, and I can’t find settings that work and have terrain under overhangs be navigable. How does this package go about finding the different layers with raycasts?

Also, quick question, in the documentation, the following image shows that “8 connections” is supported for this graph type but it doesn’t seem to be in Unity.

Finally, does this graph type now work with ProceduralGraphMover? I read it doesn’t at some point but I realized the message was pretty old.

Thank you, and dont hesitate to ask if you need more details.

Hi

Try out the beta version, it supports a few cases better. Including 8 neighbours per node.

The graph calculates the layers automatically based on the raycast hits.

1 Like

Thanks for the speedy answer :slight_smile:

Does it do 1 raycast per “grid cell”, but can register multiple hits per raycast?

Here’s a use case I have. You can see there’s a floating block, and underneath, the terrain is not navigable. That should be a pretty simple case handled by 4.2.19 right?
Any way you could take a look at the settings on the right and tell me if you see something that’s obviously wrong? Thanks <3

Is the whole terrain the same mesh collider?

I think 4.2.19 has a limitation that different layers must be on different mesh colliders.

1 Like

Yep, that was the case, but installing the beta worked!

Thanks :slight_smile:

edit: seems like it should work since I can select the graph in the component, sweet.

Now, I’ll try it but in case you can save me a bunch of failed experimentation, would you mind confirming that I can now use the layer grid graph with the ProceduralGraphMover?

Thanks for the amazing work.

Ok, it works great with the ProceduralGraphMover, nice work! And the 8 connections too. Pretty happy :slight_smile:

1 Like