How to check if a certain area is fully inside a NavMesh?

In my game I want to be able to drag and position buildings on the terrain. I am using NavMesh for collision. How could I check if a certain area of the NavMesh is fully walkable?

Good day.

Nav Mesh is not for collisions. Navmesh is a different suystem from colliders. But yea, Nav mesh agents act as colliders with other nav mesh agents and obstacles. But Nav Mesh is for NAVigaiting. Using an area to movenav mesh agents on there.

You need to Create Colliders components mark as “trigger”, detect other colliders (objects) with OnTriggerEnter or OnTriggerStay. You can also use Vector3.Distance to know the diistance between them, and do what you need.

Go look some tutorials about colliders.

Bye :smiley:

NavMesh.SamplePosition + NavMesh.Raycast

Combining results from SamplePosition() and Raycasting between those points should give you approximate result. If navmesh structure is very differential then it will fail but for simple navmeshes this might be good enough.