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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Add comment