Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.0.0

1.2.X

7000.0.0a1

Issue ID

ECSB-303

Regression

No

Unity Physics: issues observed in raycast and shape cast results when dealing with different collider types

Package: Unity Physics

-

Reported by our users on discord and brought to our attention by [~philippe.stamand]]:

*Description of the issue:*
There was a discussion on discord about unexpected behaviours related to raycasts and shape casts. 3 inconsistencies/issues were brought up:
# There are no backface hits for convex colliders (primitives or meshes), but there are backface hits for non-convex colliders
# (see [^2023-05-10 09-05-38.mp4] ) the green upward spherecast hitting this non-convex plane mesh returns some red hit normals that point "upwards" (so dot(hitNormal, castDirection) > 0f )
# a spherecast hitting a convex plane mesh collider (same mesh as in the video, but set to convex) returns a hit, but a raycast doesn't. Could there be an issue with convex hull generation for meshes that are completely flat?

Note that some items in the list above might be expected behavior. We have to confirm which are, and which aren't.

*Context:* See thread [here|https://unity.slack.com/archives/CG99ZKY9L/p1683724375589639] in #ext-unity-physics.

*Potential solution:*
* Fix the issue with raycasts on flat convex meshes not working (point 3 above).
** According to [~philippe.stamand], no matter which side the cast originates from, there is no hit.
** More information on the observed behavior:
*** Collisions work: when putting a dynamic Rigidbody with a box collider over the convex plane collider, and letting it fall on it, the box does properly collide with the convex plane.
*** Sphere casts work: a sphere cast detect hits on both sides against the convex plane collider
*** Ray casts don't work:* a ray cast never detects hits on any side against the convex plane collider
* For the rest (1, 2), document the expected behavior.

  1. Resolution Note:

    Won't fix for now.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.