Can I make SphereCast work with triggers?

It seems that SphereCast won't cast against triggers (even though RayCast does...)

Is there any way that I can make them work with triggers? (Maybe a layer setting or something; I am hoping here!)

A bit late maybe, but it seems that there is a workaround:

  1. create a new child object under your
    trigger object
  2. add a collider to the child object
    that has the exact same shape as the
    trigger
  3. create a new layer mask (let’s say
    “ColliderCast”) and set this layer
    mask on the child collider
  4. go to the Edit → Project Settings
    → Physics Panel
  5. 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.

Hope that helps. Peace :slight_smile:

sorry, but no the reference says you cant

however you could try a more complicated version of raycast
like having a common center and shooting a bunch of rays from it in different directions
or if you are using raycast in an update (which i dont recommend) you could lerp the direction to essentially create a sphere.

though doing it that way, i can’t foresee it being particularly useful because of how inefficeint it is
good luck