Search Issue Tracker
Won't Fix
Votes
1
Found in
2018.4
2019.4
2019.4.15f1
2020.2
2021.1
2021.2
Issue ID
1315339
Regression
No
A Raycast to the point of Collider.ClosestPoint will yield inconsistent hit/miss results when ray is parallel to the Collider
How to reproduce:
1. Open the attached project (case_1315339-RaycastClosestPoint)
2. Open DebugSampleScene
3. Click Play
4. Observe what is printed on the Console
5. Change the Z Position of the CubeTest object from -4 to 4
6. Observe Console
Expected result: The Collider is still being hit
Actual result: The Collider is no longer hit
Reproducible with: 2018.4.32f1, 2019.4.21f1, 2020.2.6f1, 2021.1.0b8, 2021.2.0a6
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
- Unity is loading internal version of SharpZipLib instead of local version
- The Context Menu items are ordered incorrectly
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
- “error CS0433: The type 'CodeBinaryOperatorType' exists in both 'System.CodeDom and 'System" compilation errors are thrown when opening a specific project
Resolution Note:
This is an issue with floating point precision in the PhysX SDK itself, caused by the rotation of the object. The returned closest point if off by around 7.2e-7 and because the Raycast is parallel, it misses the Collider.
The issue can be worked around by not introducing any rotation to the object and instead producing the desired box shape via the Transform Scale.