I have an object with a Sprite Mesh Renderer in a 2D game. In Editor, everything is lit correctly. When I build the game, the objects are no longer affected by lights and turn dark.
When I flip the object, it's lit correctly in build and incorrectly in the editor. I thus suspect it has to do with the normals of the mesh.
I have tried some things such as two-pass shaders I found somewhere (quite clueless about how shaders work though, sadly) and also added a Double Geometry Asset Preprocessor, but to no avail.
Why is this happening and how can I prevent it?
Answer by swansonator
Mar 22 at 07:15 AM
it'll help greatly to add as many screenshots as possible. This is a visual problem, best understood visually. This non-answer may frustrate but I've seen questions go unanswered for years so it's best to give the forum as much info as possible (visually).
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 site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
148 People are following this question.
masking light output in a shader for a 2d game
Making glowing lines and shapes
2d lighting effect
Ambient Light not working with some objects
Trying to create 2D pixel art lighting