I've tried Googling around and found surprisingly little results. I've made a standard teleportation system for VR. I'd like to not cover everything with colliders, and the NavMesh seems to work perfectly for what I want. I know I can RayCast against a surface, and then SamplePosition on the NavMesh to find if a position is near the RayCasted position. But what I really want is to be able to RayCast directly against the NavMesh and see if I've hit it. Is that possible?
There's currently no 3D world-space ray vs navmesh test. Will it help if we add it? Keep in mind: with that - it's not possible detect if you're sending the ray through a wall (not represented by navmesh geometry) and hit the floor in the next room.
It would certainly help me. Or as possibly a more flexible solution, I don't know about performant, expose the NavMesh as a mesh, then I can use it in a MeshCollider and/or render it more easily. In my use case, I'm estimating a roughly parabolic arc with x RayCasts to see if it hit anything. At the moment I'm doing a RayCast for a Collider and then a SamplePosition for the NavMesh. If it hit a Collider I throw it away anyway. I've put walls in myself, but the NavMesh seems like a perfect way to 'tag' the floor, i.e. walkable area. So yes, I'd definitely benefit from that functionality. If not can you suggest an alternate method that doesn't result in placing lots of Colliders and deciding which ones are walkable?
I see. For now - If you don't need high vertical detail - you might this useful : https://docs.unity3d.com/550/Documentation/ScriptReference/AI.NavMesh.CalculateTriangulation.html You could use the result to build a Mesh (Collider) to cast 3D rays against. Note that the triangulation contains information on the area types as well.
I know this is a really old post, but it seems the best place (so far) to ask: Can I make walls from the outer perimeter of the navmesh in some pre-runtime (aka editor) process? Making colliders is a pain and I imagine that I could create vertical box colliders from the perimeter of the horizontal triangles. I know I can get at the triangles, but how could I just get the perimeters (and ideally holes) - the edges between the navmesh and the non-navmesh? I think some modeling software calls it the manifold. Thanks, if anyone ever sees this!