Im using the shader from question

, but once I put it in the game, and my character gets close to it, it will be hidden by the shadow of the tree, which is transparent.

Any way to make the shader transparent and/or maybe use the sprite renderer sort layer system

I have been trying to use stencil configurable shader with no luck Thank you for your help

Not sure what combination of these should work: enter image description here

The character is using a normal sprite renderer.

  • 1
    \$\begingroup\$ It looks like you removed the image of your symptoms. Was this intentional? \$\endgroup\$
    – DMGregory
    Sep 10, 2020 at 13:02
  • \$\begingroup\$ Yes I need to replace it \$\endgroup\$
    – Kepol
    Sep 10, 2020 at 13:04

1 Answer 1


Ok I solved the problem giving the character these properties:

enter image description here

And the tree shades these values:

enter image description here

As well as making the tree shades the same sorting layer as the character

In order to do this I had to insert the stencil section from here:


Also I put none in the mask interaction of the character as this is what was hiding the character, not sure if its a bug, but this link also mention it: https://forum.unity.com/threads/shader-stencil-and-sprite-masks-not-working-together.756041/


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .