In my Unity project, the player sees the action from a bird's eye view. If he walks into a building, the roof should become invisible. The problem now is that the lighting shouldn't change, which means that the sun and other light sources that didn't penetrate through the roof before shouldn't do the same with the transparent roof. This means that the interior remains illuminated only by the interior lighting, even if there is no longer a roof.
The blue areas in the image should simulate the shadows cast by the sunlight source. Note: This does not fully describe the problem mentioned, since it is not only about the shadows, but also about the illumination of the interior. (But I didn't know how to draw this...)
How can I achieve this?
EDIT
Through @DMGregory's answer, I set the MeshRenderer of all roof objects to "OnlyCastShadow" via script. However, this doesn't seem to work in play mode. It looks as if the sun's rays are penetrating the building again outside of a certain area.
What could be the reason?