- Home /
Navmesh Agent get distance
HI All,
This is more of theoretical question and hence looking for various implementation methods.
Currently to make navmesh working with agent we set navmesh agent targetand then calculate distance on it.
I am trying to get distance without setting destination (I.e without moving the source to target).
Is there any method to provide distance with just providing source and targetwith Navmesh?
I can't find an example and I haven't written anything to do this myself but...
I would use Nav$$anonymous$$esh.CalculatePath then measure the linear distance between each path corner and add them up to find out how far the target is from the agent along the navmesh.
I'm sure I could make that work easily enough in my project but as you are using a navmesh agent it will confuse things as it is calculating it's own path which may be different to the one you calculate.