Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.39f1
2022.3.31f1
6000.0.4f1
Issue ID
UUM-73286
Regression
No
GameObject does not receive light but casts shadows when setting Light.renderingLayerMask in Play Mode
Reproduction steps:
1. Open the “ReproProject“ project
2. Open the “Assets/Scenes/SampleScene“ scene
3. Enter Play Mode
4. Observe the Game View
Expected result: The sphere receives light and casts a shadow
Actual result: The sphere casts a shadow but does not receive light
Reproducible with: 2021.3.39f1, 2022.3.31f1, 6000.0.4f1
Reproducible on: Windows 11 Pro (22H2)
Not reproducible on: No other environment tested
Notes:
1. Changing the Rendering Layers to “Light Layer 1” manually in the Inspector window for the “Directional Light” GameObject does not reproduce this issue
2. When changing the Rendering Layers to “Light Layer 1” manually, and then removing the “Light Layer 1” LayerMask makes the shadow of the sphere disappear
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Asset Bundles] A new bundle hash is not generated when the name of a serialized field is changed
- Icon section shows incomplete message and unusable check box in Build Profiles and Player Settings window instead of “Not applicable for this platform” for Dedicated Server Platform
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
Resolution Note:
Hi, thank you for the report.
It would appear this is not documented correctly, but you will need to set the mask on directionalLight.gameObject.GetComponent<UniversalAdditionalLightData>().renderingLayers instead of directionalLight.renderingLayerMask in your script when using URP.
I hope this resolves your issue.