Search Issue Tracker
By Design
Votes
1
Found in
2017.3.0f3
Issue ID
1005906
Regression
Yes
Shape raycast with a dimension set to 0 and hitting at an angle reports incorrect hit.point
Dev notes:
https://docs.unity3d.com/ScriptReference/Physics.SphereCast.html:
Notes: SphereCast will not detect colliders for which the sphere overlaps the collider. Passing a zero radius results in undefined output and doesn't always behave the same as Physics.Raycast.
Any shape casts with zero radius/size are very likely to produce undefined results. It's better to just use normal Raycasts in those situations.
Steps to reproduce:
1. Download and open the latest attached project("Repro.zip")
2. Move the "RaycastHelper" gameobject around the scene to hit objects at an angle
Expected result: hit.point is always where the Raycast hits
Actual result: hit.point is often reported at the start of the Raycast or behind the actual hit
Reproduced on 2017.1.3p1, 2017.2.2f1, 2017.3.1p2, 2018.1.0b9, 2018.2.0a1
Notes:
- This happens with every shape collider, with radius needed to be set to 0 for the bug to occur
- The project provides a visualization of where the hit occurs, placing a debug display at that point
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Shader Graph "Zoom Step Size" can be set to 0 even though the zoom still works
- Enabling/Disabling the Deprecated Nodes doesn't apply to the opened Shader Graph unless any Variable is added to the Blackboard
- Group Selection title text size is smaller in renaming than the actual font size
Add comment