Search Issue Tracker
By Design
Votes
0
Found in
4.3.0b3
Issue ID
566533
Regression
No
Incorrect normal is returned in the RaycastHit2D when the fraction is 0
Steps to reproduce :
- import the project attached
- open the ControllerTester scene
- press right to attempt to climb the ramp and notice that the normal is reported as -1,0
Explanation :
Both the line-cast and ray-cast for 2D return colliders that exist at the start of the line/ray. This differs from 3D which doesn't do that.
In the case of something found at fraction=0 i.e. the start of the line/ray, it indicates that the line/ray starts inside a collider. In this case there is no collision normal as the line/ray did not intersect any surface.
Under these circumstances, rather than return a zero collision normal, the collision normal is set to be the opposite of the line/ray vector.
It should be note that the example provided moves the character around by manipulating the transform and bypasses the 2D physics itself. This causes interpenetration. In the example project, if I ignore hits at fraction=0 then the character simply falls through the levels.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Text is unreadable when DLSS is applied to the Canvas with Render Mode set to World Space
- NullReferenceException errors appear in the Console when changing the values of Visual Effect Control Clip Events' Attributes
- Crash on TextCore::OTL_TableReader::GetOpenTypeLayoutTables when using Japanese Font as TMP Fallback
- TreeView.AddItem performance regression when opening EditorWindow
- Shadows are not visible in Player when using DX12 with Forward+ or Deferred+ rendering in URP
Add comment