Troubleshooting Light2D mask issue

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Diet Estus

I am trying to create a node which makes whatever is standing within it invisible.

The structure is:

Node2D
  Sprite
  Light2D

The texture of my Light2D node is a simple transparent square, 64x64 pixels, and mode is set to mask.

I notice that when I only have one of these nodes in my scene, everything works fine. My player becomes transparent when he crosses it.

If I have two of these nodes side by side, however, they act strangely. If the player is in the left node, he is only transparent if his center is within the left half of that node. If the player is in the right node, he only transparent if his center is within the right half of that node. If I move the nodes 64 pixels apart from each other, they begin to work as intended.

What could cause this?

:bust_in_silhouette: Reply From: zhagsenkk

Light2D doesn’t work well when there are two or more Light2D worked in mask mode.

https://forum.godotengine.org/32069/problems-when-using-multiple-light2ds-in-mask-mode?show=32069#q32069

So I think they should develop a Sprite Mark Function/Node.

But …