Hi, as per title I have been seeing that spherecast hit points are returning as world position (0,0,0) if the spherecast starts from inside the collider returned by the RaycastHit. Is this behaviour intended? Is there anyway to circumvent it?
Having “Queries Hit Backfaces” in the project settings either enabled or disabled does not change this behaviour.
Yep, it’s intended.
From the SphereCast documentation:
Notes: SphereCast will not detect colliders for which the sphere overlaps the collider.
If the collider is a non convex mesh collider then ‘Queries Hit Backfaces’ will work, but only if the spherecast isn’t already intersecting the outer surface of the mesh collider.
The thing is is that the spherecast is detecting colliders for which the sphere is overlapping. The collider returned by the raycast hit is the overlapping collider, but the hit point is returning world origin.
The returned colliders which I am experiencing this are primitive shapes (capsules, box), I have not tested with mesh colliders.