Search Issue Tracker
By Design
Votes
1
Found in
2017.4.1f1
Issue ID
1040418
Regression
No
NavMesh.SamplePosition calculates position between nearest points incorrectly
How to reproduce:
1. Open given Unity project
2. Enter "BugScene" scene
3. Notice 3 green lines in the scene menu
4. Try to move "WRONG!!!_NavMeshSamplePosition_Checker"
5. Notice that line is connecting randomly
Expected result: According to the documentation, NavMesh.SamplePosition() finds the closest point
Actual result: Lines are connected randomly
Reproducible with: 2018.3.0a1, 2018.2.0b4, 2018.1.2f1, 2017.4.4f1, 2017.3.2f1, 2017.2.2p2, 2017.1.4f1
Comments (1)
-
michaelday008
Oct 04, 2019 10:50
I've added my feedback and photo about this bug here:
My post: https://forum.unity.com/posts/5030135/edit
As you can see from the photo and forum post, it's returning a point 2 meters away downward rather than a point 0.1 meters away sideways like it should.
2019.1.10f1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- EditorGUILayout.PropertyField foldout icon inside Vertical Layout Group has an incorrect indent when used with OnInspectorGUI()
- [Android] [iOS] "NullReferenceException: Object reference not set to an instance of an object" throws when entering the Play Mode/opening the application
- The Player freezes on load when building Web platform
- Animator "Conditions" tab breaks when the only Parameter is deleted and another one is created
- "Shader error in 'Universal Render Pipeline/Lit': maximum ps_5_0 sampler register index (16) exceeded" error thrown after a build is completed when the "LOD Cross Fade" parameter is enabled
Resolution Note (2021.1.X):
SamplePosition() is by design looking for a position on the NavMesh by first projecting the point up or down, and only when that does not return any result will the method search for other positions nearby. This behaviour is useful for some queries that need to inspect the NavMesh in a 2D plane.
The documentation will be updated to reflect this behaviour.