- Home /
Block 2D light with wall
How can I block the light from 2D Point light with walls? I know there is a lot on this topic but nothing recent. Is there a way to do this easily without importing external shaders? Since Unity added 2D light support recently.
Answer by fblast1 · May 06, 2020 at 02:32 AM
You can select your wall sprite and at additional settings you'll find sorting layer
set that layer to other than the default and it will not receive light
since 2D light system lit the sorting layer objects selected in the Target Sorting layer in the light components
you can fairly manipulate it to your requirements.
Regards
If I do it as you say it, the wall will not be lit. But the light will still shine through it. So this does not answer the question. Having the same issue. Does anyone have a solution?
Regards
Answer by kameleon79 · Feb 16, 2021 at 11:40 AM
@PeanutButte7 I did found a solution by setting the Shadow Intensity at 1 on my light source and then, the shadow caster 2d will completely block the light.
The only thing is that your shadow will be 100% opaque too.
Your answer
Follow this Question
Related Questions
2D Point Light not working correctly on Tilemaps 1 Answer
Point light "resolution" worse and worse the further it is from spawn point 0 Answers
Lighting 2d Sprites in 3d environment 0 Answers
Multiple lights disable additive intensity for Sprites-Diffuse? 0 Answers
Is it possible to use soft shadows in 2D using URP? 1 Answer