How to make my raycast also hit deactive objects WITHOUT showing the object?

I know how to make the raycast only check one specific layer, but the objects on the layer are deactive during one of the raycasts that I need.

  1. Is there a way to make the raycast hit deactive objects in just that one raycast,

  2. Should I change the objects on that layer to 0 alpha (fully transparent), do the raycast, hide the objects, then set alpha back to normal,

  3. Or is there another solution that’s better?

mesh renderer off, yes.