Why does the directional light come through the roof of my room created by procedural mesh?

Hi, I’m new to Unreal engine and I was trying to use this to build my own meshes dynamically.I use it to build a room. But when i add directional light, it can shed through the roof directly. I tried to set the material as two-sided in the editor and in the C++ source code both, and tried to set “ActorMesh->bCastShadowAsTwoSided = true; ActorMesh->bCastDynamicShadow = true”. But all these methods failed. Actually, my room walls are double-faced, and the light still shed through them.

The directional light is used for world lighting. Switch to spot/point lights and post process volume to light interior scenes.

However, my uassert-mesh has shadows while my procedural walls have none, and my uasserts are also loaded dynamically. As you can see in the following two pictures, the sofa and the table are uasserts, and betwwen the marked chairs and their shadows, there is a wall actually. But the walls have no shadows.

][2]

Yes i see that. Interior lighting is a little tricky because unreal does not have “bounce” lighting and so I recommend looking at the Berlin flat example under the learn tab to see how that was put together. We have to cheat a little to properly light an interior scene. So that shadows are realistic and light balance is realistic.

Thank you for replying. After careful checking, I found the problem has nothing to do with directional light. Actually, I lost a function “int32 GetNumMaterials()” . When i added the function, the shadow of the walls show up.