Robmaister / SharpNav

Advanced Pathfinding for C#
sharpnav.com
Other
534 stars 165 forks source link

Agents do not move when requested target is on the same polygon #58

Open 70fu opened 8 years ago

70fu commented 8 years ago

When a new target is requested via RequestMoveTarget on the agent and the given target is on the same polygon of the navmesh as the agent, then the agent does not move.

Robmaister commented 8 years ago

This is something that I'm aware of as the bug appears in the Examples project. It was pretty low on my list of bugs to fix as I assumed it was on the Examples end and not the SharpNav end. I can look into this soonish.

kulesz commented 8 years ago

I can confirm - this bug is present both in example project and custom project made from scratch. Is there a simple way to fix it?

Robmaister commented 8 years ago

My most recent changes to the pathfinding API (refactoring and cleaning things up) introduced alternate behavior where agents appear to be running back and forth on the boundary of the target polygon, I'll hunt down the source of the bug and include it in the next release.

TomKuhn commented 2 years ago

I fixed this up locally - NavMeshQuery's InitSlicedFindPath earlies out too fast if the source and destination polyID's are the same Move the check down below after the query has been initialized.