- Home /
2d dynamic lighting?
How could I make, in a 2d scene, a lantern be the only thing giving off light, and you can't see the rest of the scene except what the lantern is lighting up. I've tried everything with fog and environmental lighting, but still everything stays lit up with the lantern area being a little brighter. Any suggestions? Thanks for any help!
Answer by hubbyo9 · Jul 26, 2013 at 06:31 PM
I think what you want is shadows, and that is a pro feature only
Actually only dynamic shadows are a Pro only feature. Here's an answer how to get shadows in Unity Free. You can also have simple dynamic shadows as explained in this youtube tutorial. You get the Blob projector byt following this answer.
Answer by Kiloblargh · Jul 26, 2013 at 08:03 PM
Here is a super cheesy but definitely-will-work solution. Make a second camera on a higher layer than the first, and have it render a shadow object that is twice the screen size and centered on the lantern; that is just a flat plane with a multiply particle texture on it of all black with a blurred white circle in the middle. You could also make it a mesh with vertex colors but no texture map, and you can animate its scale or have more than one of them and animate their position and color if you want a flickering effect.
Plenty of 2d games from the '90s got away with doing that.
Umm, that sounds like it might work but I am way confused on how to do it. I am really new to unity obviously so all I understood out of that is make a second camera then I got lost hehe
if you're super new don't worry about dynamic shadows. $$anonymous$$ake something simple
Answer by F-N · Feb 16, 2016 at 12:10 PM
For people who are still trying to achieve this in a simple way without Unity pro: Add a point light and add a material to a sprite(prefered shader: sprites/diffuse). Then go to environment lighting settings under Window/Lighting/Scene and finally change the ambient intensity to a really low value or just to zero.
Your answer
Follow this Question
Related Questions
How can I achieve this particular 2D lighting effect? 2 Answers
2D Lights with Unity 4.3 2 Answers
Directional Light seems to have no effect on MeshRenderer. 1 Answer
ortographic spotlight ? 1 Answer