How to make path stick to the ground?

  • A* version: 5.0.2
  • Unity version: 2023.2.20f1

Hi, I’m using a grid graph in my game to calculate pathing for units. Everything works pretty well (awesome asset, thank you!), except I’m running into issues with stairs (not a layered grid graph, units cannot go under stairs).

The path produced (not modified) returns a path which follows the ground which is great. However, the path is not smooth so I tried to add the simple smooth modifier but the path is still wonky there (not a straight path from start to end):

I looked into the raycast modifier which produces a clean straight path that I want, however this modifier doesn’t follow the ground:

What’s the best way to get a clean path (like the raycast modifier) that also sticks to the ground instead of floating in the air?

Thanks
Dat

I believe the Funnel Modifier may help here? This is just for the indicator you built, correct? Agent movement is fine?

Nice, thank you that worked! I was using a Funnel + Raycast modifier when I first tried and it floated, but using Funnel (high quality) + Simple smooth works nicely now.

Thanks for the fast reply!

1 Like