- Home /
Unity2D Sprite lighting Diffuse Material is just black
I have a sprite in my scene and I created a new material and changed the shader to Sprite->Diffuse. I then added a point light between the camera and the sprite gameObject but nothing changes.
Is this incorrect? I've been looking at other resources and youtube tutorials that just worked by following those steps. Perhaps there might be a setting I need to change for rendering as well?
Answer by kuos · Nov 11, 2016 at 10:07 PM
SOLVED: Scale of Z for the gameObject that the sprite is on must be set to at least 1. Beginner's mistake.
Oh my god, you are a life saver. I've been looking high and low for this, assu$$anonymous$$g there was a quick fix somewhere. And it was.
Answer by dpod42 · Nov 24, 2017 at 08:44 PM
I'm having the same problem. But changing the Z doesn't do anything. I've tried placing it in front of the light and putting it at 1, 2, 3 and etc, but nothing happens. I made one sprite and one animated sprite with similar settings. The animated sprite renders black and doesn't react to the light no matter what, but the stationary sprite reacts to light. I have no idea what's going on!
Doh...
Scale was set to X 6.25 Y 6.25 and Z 0
Z 0 Causes the object to "not exist" and gave it no ability to react to light. Problem solved XD
Answer by Emrys_Q · Sep 16, 2018 at 06:01 PM
yeah the Z scale is one thing, but in my project i change the Z but it didn't change too much. then i think to change the position Z, and it works! so in case someone have the same problem as i have, here is another solution