I’m making a 3D game-strategy, where I’m using NavMeshAgent
to move player’s tanks.
I “baked” the scene in tab "Navigation (Obsolete)"
, set everything up fine. Tanks bypass all objects, everything is fine. But, when I instantiate a building on the scene with code, while game is running, tanks are ignoring it and don’t bypass the building. I found a metod to recalculate Navigation on entire map:
NavMeshBuilder.BuildNavMesh().
As i understood, it starts the same “Bake” in Navigation by code. But it is not optimal and the game stops for a certain time while the NavMesh
is calculated. Maybe there is a way to recalculate only certain part of map, or take an object to consideration? Or there is another solution?