+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?

in Engine by (1,547 points)
edited by

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 ...

by (25 points)
edited by
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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.