So, I just started into Lighting. I’ve been on URP for a while and everything has been fine for that, but I’ve been sticking to default materials and such. Today I decided to finally experiment with lighting but immediately ran into a very weird issue. I added a global 2D light to my scene, did nothing else, and suddenly my entire sorting is all messed up. See the two images. Only difference is the enabled status of the Global 2D light, everything else is the same. I’m assuming there is a setting that is needed somewhere that I’m missing for lighting. Something that overrides the sort order? Any help would be appreciated.
Bump as I’m still totally baffled here.
What settings do you have for your TilemapRenderers and/or SpriteRenderers?
What layers are your light targeting? What layers are on your renderers?
Tilemap render:
top right
individual
auto
None
Sprites-Default
And everything of import in the scene is on the same sorting layer, order 0 in layer and rendering layer1
The sprite renders:
white
not flipped
Simple
None
Pivot
Sprites-Default
Same layering options as the tilemap.
Targeted layers is just default. Adding the main layer everything is on doesn’t change anything.
Also note I’ve since tested point lights, they do the same thing so it seems any lighting causes this.
I also changed the material to the lit one, but didn’t help any although curiously it acts like it is transparent with no lighting, don’t know if that is normal or a symptom.
You have URP but do you also have the 2D Renderer? On your 2D Renderer asset, does it have the correct transparency sort axis?
AH-HA! That was it. Odd that it didn’t kick in immediately when I switched to URP, but whatever, that was the issue. The URP was still using the default axis. As soon as I switched to the proper custom axis it looks the same with and without the lighting on. Thanks so much!