I’ve just run into this issue. The Script Reference page for SphereCast mentions “sphere cast does not work against colliders configured as triggers” but doesn’t say why or suggest a workaround.
I’m thinking I could do several ray casts and get approximately the same result, but it is a little frustrating. Anyone know any more about this or know a better solution?
A bit late maybe, but it seems that there is a workaround:
create a new child object under your trigger object
add a collider to the child object that has the exact same shape as the trigger
create a new layer mask (let’s say “ColliderCast”) and set this layer mask on the child collider
go to the Edit → Project Settings → Physics Panel
disable all collisions on the “ColliderCast” layer mask.
Thus, nothing will collide with a “ColliderCast” object so this new collider shouldn’t change the behavior of other objects passing through.
However the sphereCast should collide with it, because it’s a collider and not a trigger (except if you filter the “ColliderCast” layer mask).
It seems to work for me.