Is there any way to have lights actually apply lighting to 2D textures, without losing the transparency of the sprite? I have been using the Particles/AlphaBlended Shader to display my sprites.
I would like to have a dark room, and allow the player to use a light to make his way through, but I can't seem to make lights work.
If there isn't a way to make the stock lights work, then does anyone have another suggestion? I have heard of many ways to achieve similar effects, but I am not sure of the best approach considering Unity is built different than Engines I am used to.
Answer by zee_ola05
Feb 23, 2014 at 08:34 PM
Create a material and use Sprite/Diffuse shader. Drag it to your sprite gameObject to apply the material. Voila!
Answer by Eric5h5
Dec 13, 2011 at 09:04 AM
On the particle renderer material, use a shader that uses lighting.
I am confused by your comment. What do you mean by the "particle renderer material"?
The material used for the particle renderer.
Oh, I believe you misunderstood the question. I am using a texture on a plane for my character's sprite. I want to light him, not a particle system.
Well, same answer basically...on the sprite renderer's material, use a shader that uses lighting.
Use a shader that has transparency and lighting.
Answer by Noob_Vulcan
Jul 30, 2015 at 03:34 AM
Sprites-default material does not respond to lights , but unity also supports another shader (Diffuse ) for sprites that supports lighting.
You just have to change the shader in Sprite renderer component
For more detail you can refer How to make 2D Sprite light responsive
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
6 People are following this question.
Lighting looks really weird in 2D game
Unity 2D camera and lighting issues
2D platformer advice
How can I cycle through sprites on button presses (C#)?
Is it possible (how?) to hide a light effect with a 2D sprite?