Working on a project using 2D URP and am kinda perplexed. Created sorting layers for my sprites ie. for the floors of my map and the walls but only "Layer 0" gets illuminated by the global light 2D. The rest of the scene is black.
My current version of Unity is 2022.3.5f1
Works normaly if I use a different material that doesn't do lighting like sprite-unlit-default, but with sprite-lit-default everything but "Layer 0" gets illuminated. Global Light 2D targets everything.
I tried checking if everything is correctly assigned but honestly at this point I have no idea because it doesn't really matter what is assigned in the Global Light 2D as target. It's always "Layer 0" that gets the light. If I place my wall sorting layer as "Layer 0" in the order then the walls get the light. If the floors are set as "Layer 0" then the floors get the light.




I've just had this problem, same Unity version. I gave up, closed project down, then went back later and it was working. Made some changes, that new part wasn't working. I deleted a package that wasn't required. This forced a project recompile. The new lighting part then worked (it was hidden and then changed colour as the compile finished). So it looks like something to do with the lighting requires complilation of some elements - fair enough but no-one mentions this! I also have domain reload turned off. If I turn this back on and run the game, it gets compiled and the sort layering works. It doesn't work in scene view until this happens. Hope that fixes it for you.