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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
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.