- Home /
Make a 2d scene pitch black?
I would like to make a game that is pitch black so that the player has to use lights to complete the level.
I have searched for ages about this and know about editing the ambient light and fog colour in render settings. For 2d textures, this does not work... Please help!
Answer by 09millarda · Aug 12, 2014 at 02:35 AM
Never mind, i have figured it out... You need to first make a material for the sprites that can be affected by unity light. Change the shader of the material to [Sprites -> Diffuse]. Change the Material on the renderer menu of the object to this material. The object can now be affected by all unity light including ambient lighting...
Answer by KMKxJOEY1 · Aug 12, 2014 at 01:05 AM
I'm sure there are rather complicated ways to go about this, but from a really simple perspective here is a quick way to do this (not sure if this would work for what you have in mind for your game)
A pitch black sprite background (an unlit shader so that your sun will be irrelevant to it), then lighted areas are just inactive objects in front of it. When a light is 'turned on' set the sprite active and it will appear to 'light up' in front of the black sprite. Obviously you would need invisible colliders that are always active or whatever you need for your game.
Your answer
Follow this Question
Related Questions
Why my 2D shadows have low resolution? 0 Answers
Using Lightning to light up a dark 2d level 1 Answer
2D Animation does not start 1 Answer
no lit darkness 1 Answer
NGUI objects are dark 1 Answer