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
- A black bar appears on the Game View toolbar when the Game View is resized vertically
- Double separation lines are present in Override Controls in a DefaultVolumeProfile Asset
- Silent crash when multiple child GameObject Colliders are triggered while attached to a Parent GameObject with Transform Scale set as (0; 0; 0)
- Numbers of output expressions does not match number of output error is thrown when converting node to property Output
- GameObjects with higher Render Queue values are being reflected on GameObjects with lower Render Queue values
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.