SphereCast does not collide with mesh if radius is small

I’m trying to use Physics.SphereCast to detect whether a projectile should hit a target. The target object has a mesh collider. My code works fine unless I set the radius parameter too low.

All casts hit the mesh when the radius is 0.08 but they all miss when the radius is 0.05.

Any ideas why?

Here are screenshots of several casts with different radiuses:


[20998-radiuses+side.png|20998]

  • The spheres were added manually to indicate the radius parameter of SphereCast. Their position in the image is arbitrary
  • The yellow lines show the center of the cast. The red lines show hits - connecting the impact point with the center line at the hit distance
  • The red lines may seem shorter than the radius. That’s only because they are 2D projections and may not be parallel to camera

I don’t suppose these matter, but just in case, my Physics settings:

  • Min Penetration For Penalty: 0.01
  • Solver Iteration Count: 6

Physics.SphereCast will return false if the cast begins within or partially within a MeshCollider. (Non-convex) MeshColliders will only report collisions on the outer surface of the mesh, not the inside.