MilosLukic / Godot-Navigation-Lite

Godot plug&play implementation of detour. It allows user to have multiple navigation meshes, fast cached obstacles, and realtime navmesh changes.
Other
132 stars 12 forks source link

Y axis elevation doesn't add path points #5

Open rustwork opened 4 years ago

rustwork commented 4 years ago

If there is no hard obstacle to go around in the X/Z axis, then the navigation always draws a straight line to the target, even when there is elevation in the Y axis that the path should climb over. This causes the character to move underground through hills etc.

Here's a screenshot from your example project, where I changed the navmesh to have Tile_Size=8 and Agent_Max_Climb=3 You can see that the line goes straight through the hill created by the spheres.

navbug

MilosLukic commented 3 years ago

Yes, I noticed this behaviour, but I didnt have time to find out the reasons for it (It could be the simplification logic for the path, not sure). I didnt pay much attention because with physics set up, the character would move up the hill. I know it's a little bit hacky, and I'm very much open to accepting PR's that enable more accurate paths.

Pyredrid commented 3 years ago

Is there any chance of this bug getting fixed? It's affecting my project as well, and so far all my attempts to fix it have failed worse. The lack of comments in the codebase doesn't help with understanding what's going on...

Pyredrid commented 3 years ago

Submitted a Pull Request that should fix this bug. If anyone has a Windows environment and can double check it builds correctly there then it should be good to go.