Hi All,
I have a 2d project where i enabled the URP to be able to use 2d Lights. I managed to get them working using the Sprite-Lit-Default material and an additional camera. Also the Canvas is set to Screen Space- Camera.
The issue I am having is, that SortingLayers seem to have no effect, or at least not the effect which I am looking for ( i tried “sorting layer of canvas”, “target sorting layer of the 2d light” and “sorting group components”).
What I am trying to achive is the following:
I have a street lamp with attached 2d light which needs to illuminate itself (this works) this lamp is on a layer in the foreground. The player is behind the lamppost and its spotlight therefore should NOT illuminate the lamp.
How can I achive this effect?
Like how can I disable some lights to not affect certain assets which are in front while keeping the asset lit from other lightsources?
Basically I would need something like keeping the 2d light on the same layer as its image asset.