== PLEASE STOP SUGGESTING -inf trans + highlight/forcefield! ==
please read this entire post before suggesting a common work-around. It’s probably already been mentioned.
The missing feature
It is currently not possible to make an invisible part cast a shadow reliably on all platforms.
The use case
I have a small room the player can enter. It would be cramped to enter this space in third person if the camera was forced to stay in the room so the camera is outside the room looking in with any walls that would block the camera’s view into the room made invisible, similar to a game like The Sims.
My problem is that I do not want this room lit as if it’s outdoors. I want bright sunlight to stream in through the windows and light up the floor but for the rest of the room to be lit as if it’s indoors and I want this to work whether the wall the window is on is visible or not.
Example images:

The proper way to do what I want would be to make invisible shadow casters that will ensure the room is in shadow from the sun except for the sunlight let in through the window, but Roblox does not have this feature (unlike many other engines like Unreal, Unity, and Godot).
Another use case is first-person shadows. Let’s say you want the player’s avatar to be invisible while the player is in first person but you still want them to cast a shadow. Good luck with that.
Workarounds
Give a part the Forcefield material, and then set it’s transparency to either math.inf or -math.inf.
On PC this will cause the part to not be rendered but cast a shadow. This is what I’m doing right now. This isn’t a good enough workaround though because it doesn’t work on every platform. On Android these invisible shadow casters don’t cast shadows, and worse on IOS these invisible shadow casters are actually still visible and cause a lot of z fighting.
This workaround also causes SurfaceGUI
s with LightInfluence = 1
that are in a shadow cast with this method to still be lit as if in direct sunlight, even on PC where this workaround seems to work.
Place a part somewhere up in the sky where it’ll still cast a shadow where you want but not be visible without looking up ( using lighting:GetSunDirection() )
This method only works if you restrict the camera’s movement so player’s can’t look up and see random stuff floating in the air, and only works with sunlight. This should work for my use case but won’t for others.
shadow caster is the hallow white box with the window on it. The rooms are where the shadows are cast.
Implementation
I think Basepart.CastShadow
should be deprecated and replaced with an ENUM property with the following possible values:
- “None” – cast no shadows. Same as
CastShadow
= false. - “Alpha clip” or “On” – default and current behavior. cast shadows based on the transparency of the object and it’s
surfaceappearance
- “Always” – cast shadows regardless of the object’s transparency
- “Always alpha clip” – Always cast shadows regardless of
basepart.Transparency
, but the alpha channel of the appliedsurfaceappearance
will still cause parts of the model to not cast shadows. Useful for more complex shadows like of a ghost floating around.