After baking,the nav is divided into regions. Now, it bothers me that I can only navigate from one region to another. What if the player to walk from one part of a region to some other part of the same region?
Moving around inside a tile should ofcourse just work.
Perhaps you have set the âstoppingDistanceâ so high it prevents the character from moving locally ? or maybe some scriptlogic is flawed - or a bug on our side.
Hi Jakob, thanks for the reply. Stopping distance is set at 1 (wich I think is default), so I don´t think is that. I´m using a modified version of unity´s example AIThirdPersonController. I only changed something to stop the character from spinning too much after reaching the target.
The docs say that pathfinding is determined by defining a sequence of polygons from the target to the character, so I was thinking that maybe you simply can´t get from one region to another part of the same region cause maybe this regions in the image are actually those polygons used for the pathfinding algorithm. I think my problem could perhaps be a scale thing that has made the nav mesh bake polygons too big.
I was able to re-bake the regions/polygons smaller changing the voxel size in the advance settings of the navigation window. Could this be it or I messing with something that could bring trouble later?
A path from one point to another, within the same polygon, is supposed to work.
Thanks, that made me review my code.
I found the part that is generating the problem. it´s a few lines I added to stop the character from spinning after it reaches the target. Still not getting what´s happening. Seems to be the â!agent.hasPathâ condition (line 6). If I remove it, everything works but the target never get´s cleared.
if (!agent.pathPending)
{
if (agent.remainingDistance <= agent.stoppingDistance)
{
if (!agent.hasPath || agent.velocity.sqrMagnitude > 0.1)
{agent.ResetPath();}
}
}

