- Home /
How to let Lights effect a SpriteShape
So I've installed the "2D SpriteShape" (v2.1.0) package from the Package Manager and it works fine. Then I updated Unity to Unity 2019.2.0 so I could download the "Lightweight RP" package and it works fine. The color of all the sprites are affected by the "light gameobjects" I place except for my ground object made with a SpriteShape.
Now what I think happens is that Lights only affect SpriteRenderer's and a SpriteShape doesn't have a SpriteRenderer.
As you can see the blue light on the top affects the color of my cave background but the SpriteRenderer on the bottom is not affected by any light.
Right here in this new picture below I removed the "Lightweight RP" package and all sprites turn pink because their material is set to "Sprite-Lit- Default" which no longer exists, except for the SpriteShape which has never been affected by the "Lightweight RP" package.
Also another bug that happened to me with the spriteshape, is that in the picture on the top (where i have the Lightweight Package) the spriteshape ground is filled up with a completely black sprite but for some reason it overlaps the top partially. However it doesn't overlap in the picture below where I removed the Lightweight RP.
I understand that the "Lightweight RP" package is still in beta (and 2D sprite shape package maybe as well but I'm not sure) however a temporary solution would be very useful and appreciated. Thanks for everyone reading and answering my question.
Answer by PaulMaget · Feb 17, 2020 at 12:08 PM
I have this problem too. URP and sprite shape are no longer in beta and the problem is the same. I tried to see how the "lost crypt" demo project was doing, but I couldn't understand. I will continue to search but a solution would be welcome ;)
Answer by Tom980 · Nov 15, 2021 at 08:11 PM
What worked for me was clicking Edit -> Render Pipeline -> Universal Render Pipeline -> 2D Renderer Upgrade Scene to 2D Renderer
in the top context menu. That should convert the materials used by your SpriteShapes to the 2D-compatible Sprite-Lit-Default shader.