- Home /
Can I find the layer of a NavMeshPath corner?
I am using a preview of a navMeshPath to determine turnbased movement distance, so the length of the preview path line needs to accurately display the distance between the Agent and the destination. On the normal layer, this works.
For some reason, with a NavMeshAgent that CAN go through a custom layer, the NavMeshPath Corners take an odd route, going to one of the points on the custom layer, before continuing its path. However, when the Agent actually moves to the destination, it always seems to take the most direct route. My script that measures the distance to a given point is thrown off by this odd route in the preview path.
The best solution I can think of would be to check if a corner is on the custom layer, and ignoring that corner for distance measurements if it is not the last corner. Is it possible to find the layer of a corner of a NavMeshPath?
I am certainly open to any other solutions to this problem.