Transparent(invisible) Cube that casts shadows

Hi guys , i need to create some objects (cubes) that will block spotlight and cast shadows on other objects , but during the game … they shouldnt be visible … is that possible ???

Yes, that shouldn’t be a problem :wink: All you need is a shader that is classified as opaque shader by Unity but that doesn’t render into the color buffer. However it has to be rendered into the depth buffer. To prevent the cube (which is “opaque”) from blocking the view to things behind it, you have to put the shader on a render queue after the normal geometry.

That’s all just a theory :wink: You have to try it. The DepthMask shader might be a good start

check this: