Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

2D lights with different sorting layers

PanzerPanzer Member

I can't get 2D lights react differently with different sorting layers.

For example, if I have a gameobject with a sprite and a shadow caster 2D, I configure the sprite in the sorting layer "players" and shadow caster to affect sorting layer "ground". If I have two lights where both affect "ground", but only one to "players", both produce shadows over "ground" with the shadow caster that is in "players".

Is it posible that one shadow caster 2D reacts to some lights but not to others?

Comments

  • jtok4jjtok4j Member

    Greetings,

    I think this tutorial has the info you're looking for in steps 4, regardings lights and the culling masks applicable to them.


     Keep on Creating! 


    Justin of JustinTime Studios (http://unity3d.expert) 

  • PanzerPanzer Member

    Sorry, but what tutorial do you mean?, I can't see the link in your comment.

  • jtok4jjtok4j Member

    @Panzer

    Sorry for the missing link. Here it is: https://medium.com/@tidyui/fast-beautiful-2d-lighting-in-unity-47b76b10447c

     Keep on Creating! 


    Justin of JustinTime Studios (http://unity3d.expert) 

  • PanzerPanzer Member

    Thank you for your response jtok4j but this tutorial does not use the new light 2D or shadow caster 2D that I am using, and uses 3D elements.

    Would you know if there's any way to get what I'm looking for with these new elements? Otherwise I might use what you say, because I'm very stuck with this.

    Again, thank you.

Sign In or Register to comment.