- Home /
Manual OffMeshLink Max Distance?
Hey, guys...
Is there a maximum distance between two manually-placed OffMeshLinks, beyond which the NavMeshAgent will refuse to traverse the connection between the links?
This is what appears to be happening in my game, and also appears to be the case in a small test scene I created.
Thanks in advance!
Looking at it a bit more closely in my very simple sample scene, there appears to be a white line drawn on the nav mesh, across the boundary of which the Off$$anonymous$$eshLinks will not work. This line is about 297m from one of the Off$$anonymous$$eshLinks. That distance does not seem to be reliable, though.
Answer by DanSuper · Jan 18, 2013 at 08:11 PM
I ran a little experiment and found results similar to your comment. The white lines appear to designate regions of Navmesh. A manual OffMeshLink will connect if both the start and end point are in the same region or an adjacent region, and will not connect if there is one or more regions between the start and end point.
The spacing of the regions appears to be related to the Radius you set when baking your NavMesh. The larger the Radius, the larger the regions appear to be. With a radius setting of 0.5 I was able to get an OffMeshlink to generate at exact opposite ends of the white region about 320 meters apart. With a radius setting of 1.0 I was able to get an OffMeshLink to generate about 640 meters apart because the white lines representing navigation regions were spaced farther apart.
I was also able to daisy chain multiple OffMeshLinks so that I was able to go from one end of a region, to the opposite end of a region 4 blocks over by only navigating 2 offmeshlinks (see picture) ![alt text][1] [1]: /storage/temp/6842-multipleoffmeshlinksspannavregions.png
It seems like this could work fairly well as a work around if you need to have an agent that needs to be able to navigate between two isolated positions that that are very far apart yet maintain a small radius on your navmesh. The use case that comes to mind in this situation is a teleporter.
Dan, thank you so much for your feedback! That is super useful, and we'll definitely look at it.