- Home /
Why does adding a point light make my sprite transparent? How can I add light but keep the sprite opaque?
Basically before I added the point light my sprite was completely opaque, now it has some transparency. I'm attaching an image below showing 2 overlapping enemies before and after adding the point light as a child to them, my point light settings as well as my material settings, which may be related?
The intended functionality is that the enemies are visible in a dark level because they provide their own light. It works, except that they're semi-transparent.
Any ideas?
Answer by burntflameyt · Mar 28, 2018 at 01:50 AM
no one is going to answer your question, im sorry dude happened to me too
So I think I solved it myself... as long as you put each object on a different z-axis for its position, they won't overlap like this. HOWEVER, the further from your light source on the z-axis you get the less lighting, so I'm picking really small values... 0.0001, 0.0002, etc. so you don't really notice any difference in lighting. ALSO, this is a bit annoying because it means every single object in any level where I'm using lighting like this needs its z-axis position reassigned on spawn. Bah.
But it does work. I believe.
Your answer
Follow this Question
Related Questions
How do I have a 2D sprite fade in and out? (C#) 1 Answer
How to change sprite opacity during runtime 3 Answers
Shader for 2D Sprite "Always Rendered on Top" Problem 0 Answers
Can I change the transparency of a Sprite only in the area where it is overlapped by another one? 0 Answers
2D collisions on a Game Object Sprite with transparent areas 2 Answers