+2 votes

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?

asked Sep 14, 2018 in Engine by Diet Estus (1,494 points)
edited Sep 14, 2018 by Diet Estus

1 Answer

0 votes

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

https://github.com/godotengine/godot/issues/22981
https://godotengine.org/qa/32069/problems-when-using-multiple-light2ds-in-mask-mode?show=32069#q32069

So I think they should develop a Sprite Mark Function/Node.
https://github.com/godotengine/godot/issues/23763

But ...

answered Nov 24, 2018 by zhagsenkk (25 points)
edited Nov 24, 2018 by zhagsenkk
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.