Hello everyone, I am having an issue when trying to get 2D lights & shadows working. Would love to get some help about this, as I'm out of ideas. I have done a good amount of Googling, and this was asked multiple times both here and in the Godot forums, but there are no answers that help.
I have a Player node with a
LightOccluder2D. There is a
Light2D on the window.
As you can see, the shadow goes over the Sprite.
What I've Tried So Far
- I've put the occluder inside the Sprite (as a child), and set
Show Behind Parent as true. Did not do anything.
- Set the z-index of the occluder to something lower. This only has an effect on the occluder shape in the editor, but not the shadow.
- I've changed the occluder polygon so that it is not closed, and set the
Cull Mode to
That sorta helped, but it leaks light:
- I set the occluders
Light Mask to 1, Sprites
Light Mask (under
Visibility) to 2, and set the Lights
Item Cull Mask (under
Range) to both 1 and 2 (setting it under
Shadow just goes back to the original problem). This worked beautifully, however now the Player sprite is not affected at all by other shadows, it just stays lit, as you can see in this gif.
Would love to hear any ideas on to fix this. Thank you all for your help.