0 votes

Update: I have answered my own question: I had to set the Item Cull Mask on Light2D to match the Particle2D node and nothing else. That did it! https://docs.godotengine.org/en/stable/classes/class_light2d.html#class-light2d-property-range-item-cull-mask

Question for anyone who knows about Light2D masking here. Here's a video of my problem (ignore me saying animation, it's not really an animation :grin: ). The basics are: my Light2D mask of a Particle2D node looks good in the editor, but in-game the entire light (just a white rectangle) flashes. It masks the particle, but is also illuminating the scene, which I don't want. I just want to mask the particle. Turning off Light Mask on the tileset does not change anything.

I have referred to the demo project and AFAIK my settings match and other questions on here.

I tried using ViewportContainer > Viewport (for the first time) for this also, but didn't get anywhere. For some reason the Viewport would only show the bottom half (not the top as I want), and it was very pixelated. I obviously did not configure it properly.

Scene tree:

TurnDust [Node2D]
  DustParticle [Particle2D]
  Light2D
  Turn [AudioStreamPlayer2D]

DustParticle non-default relevant settings:
- Material = new CanvasItemMaterial
- Blend Mode = Mix
- Light Mode = Light Only

Light2D non-default relevant settings:
- Texture = plain white square
- Energy = 2
- Mode = Mix

I also posted on the Discord.

Thanks!

Godot version 3.2.3
in Engine by (29 points)

1 Answer

0 votes
Best answer

I updated the question, but just to mark this as answered:

I answered my own question: I had to set the Item Cull Mask on Light2D to match the Particle2D node and nothing else. That did it! https://docs.godotengine.org/en/stable/classes/class_light2d.html#class-light2d-property-range-item-cull-mask

by (29 points)
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.