Search Issue Tracker
By Design
Votes
0
Found in
2018.2.2f1
2018.3.0a5
Issue ID
1071735
Regression
No
RaycastHit.normal ignores Physics.queriesHitBackfaces when Raycasting a line
How to reproduce:
1. Open User Attached project
2. Open "RayScene" Scene
3. Observe the ray casted from the bottom cube
Expected results: casted ray is deflected back when backface is hit
Actual results: casted ray ignores backface
Reproduced: 2017.1.5f1, 2017.2.3p3, 2017.4.9f1, 2018.1.9f1, 2018.2.4f1, 2018.3.0a9
Note1: functions as intended when sphere casting or box casting (check RayCreater Game Object > Ray Test component for comparison)
Note2: ever since 2018.3.0a5, all raycasting methods ignore backface
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
- Animator window has a dropdown button that throws “MissingReferenceException” error on a new project when the previous project had a GameObject with an animation
- Terrain Layer settings remain when the Terrain Layer is removed
- Terrain Layer settings UI elements overlap when a new Terrain Layer is created
- Animator State name overflows outside the visual box when the State has a long name
- UI Document file remains marked as Dirty after Undoing made changes
Resolution Note:
When a Raycast hits a triangle, it will always return the normal of that triangle and the normal is not dependent on the observer position (i.e. where the ray was launched from), which is why we’re seeing the result that we see. A manual inversion can be applied to the normal if the Raycast angle is below/above a certain threshold.
Regarding Note 1: Not true, one can see where the cast was when it hit, but the normal (blue line) still represents the normal of the hit triangle rather than the direction the triangle was hit from.
Regarding Note 2: Not true using 2018.3.0b4 on macOS. All queries presented in the script correctly hit mesh collider backfaces.