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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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.