- Home /
I answered it myself.
Which NavMeshSurface is a point (already on the NavMesh) on?
I have a collection of connected (via NavMeshLinks) NavMeshSurface's. I have a point in space somewhere nearby. I know that I can use NavMesh.FindClosestEdge, SamplePosition, and RayCast. However none of them provide me anything better than a point of intersection with the NavMesh overall. I know that a NavAgent knows which thing it is attached to, but I don't have one and I don't want to create a proxy as it may interfere with other nearby NavAgents. I know that a system of bounding boxes around the navmesh surfaces could also provide insight, but as these may on occasion overap I can't be certain 100% of the time which navmesh surface a point is on.
Another possible, yet disliked, solution is a set of serialized Vector3 positions on and associated with a navmeshsurface and at runtime figuring out which surface I am on by a "which point in this array am I closest to" check.
Any and all thoughts and ideas would be appreciated.
Thanks!
Well... for all the other curious peeps out there.... I went with a Nav$$anonymous$$eshAgent proxy. I move it to the point I am interested in, enable it, harvest the value (it d/n require a frame of update to move and attach to the navmesh), and then disable it. Its kind of a hack solution but it doesn't hurt other considerations too much.
Follow this Question
Related Questions
Is it possible to have a navmesh agent that ignores obstacles? 1 Answer
CS0246: The type or name space name ''NavMeshSurface'' plz some help 0 Answers
How do I limit the path of a NavMeshAgent? 0 Answers
NavMesh surface does not work for all orientations 0 Answers
Can you use NavMesh agents to vary driving/handling model? 0 Answers