Tell me if it is possible to generate navmesh in real time on some area of terrain.
It is very important that navmesh covers a specific area, not the entire terrain.
Thanks for your time and your answers.
P.S. I’m from Russia and maybe you can suggest the appropriate literature in Russian? But if not, everything is in order, reading in English will be useful.
The way I solved this in unity a few years ago was simply to put a subdivided plane (low poly mesh) down and raycast the verts downward so the low poly mesh loosely hugged the terrain, It does not need to be perfect for a navmesh. Then just bake that…
There might be better ways but it had no drawbacks.
Unfortunately, my knowledge of English does not allow me to fully understand your answer. Let me clarify, should I create a plane and cast rays from its edges to TERRAIN? then bake NAVEMESH on the resulting surface?
If my assumption is correct, I cannot understand how I can create a curved surface by throwing rays from the vertices of the plane.
For this approach you are not baking terrain. you are baking small meshes in a similar shape of the terrain. To do this you create a mesh and bake that, not terrain.
You move the verts of the plane mesh to the ground, and you find where the ground is by raycasting down at each mesh point.
A simple tool will do this, or you can write a simple script to move the verts of the mesh to raycast hit points.
I took the time to work on my project. When I tried to add scripts from the github repository “Unity-Technologies / NavMeshComponents” I received the error "Assets / Borrow / NavMeshComponents / Scripts / NavMeshSurface.cs (16.6): error CS0246: found. Are you missing an assembly reference? ". I could not understand the reason for this error, but I found its solution here "The type or namespace name `NavMeshSurface' could not be found. - Unity Engine - Unity Discussions / ".
The problem has already been solved, but I would like to know the reason for its appearance. To prevent this error from occurring again. Maybe you have time to help with this?