Problem with layergridgraph

Hello,

I’m planning to run this algorithm in my building model.
It is working great in the first floor (I set floor as “ground”) by using layergrid graph.

However, at the second floor it does not. After review the scanned scene, I see that the path avoids the walls (I set walls as obstacles) in both first and second floor. I understand that problem is because the wall of first floor is touched to the ground of second floor, so the path avoids moving over both of them.

Is there any solution for this problem?

I think about the parameter which let the path move over the ground a few units rather than stick on the ground, there for it could move over the wall of the floor below it.

Any suggestions?

Thanks.

Hi

When I was writing the layered grid graph I also came across that problem. So I implemented a simple solution. If you go to the LayeredGridGraph settings -> Collision Testing, you will find a setting called Offset. What it does (also described in the tooltip) is to instead of checking for collision precisely at the ground, it moves the collision testing some distance upwards so that e.g the floor or a wall below it will not affect the result.

Hope this helps!

-Aron

I set the offset and the max climb for the pathfinding and the path generated correctly.
It is working great.

Thanks for you help.

Hoang

Great :smiley:

PS: If you want to support the development of the A* Pathfinding Project. Rate it in the Asset Store and/or write a nice review about it. :slight_smile: