CanvasModulate, PointLight2D, and LightOnly Materials

Godot Version

4.2.1

Question

CanvasModulate doesn’t affect a node if it has a material with the “light only” light mode (Pictured Below)

I want the image to be shaded black while under a PointLight2D, since the image isn’t visible at all without light.

How can I fix this?

Video demonstrating the issue:

Try set your PointLight2D color to a black color and use the blend mode = mix

I don’t like that solution because it doesn’t really help with my problem, and it seems like a ‘brute force’ way of fixing things.

Hopefully this video better reveals the problem I am having: https://youtu.be/nZM9x0I5Pjk

The healthbar looks great by itself, but doesn’t mix well with other light2D nodes and CanvasModulate

If you set it to Light only only the light will affect it. I’m not sure I understand the effect you want to achieve but try changing its CanvasItem.mudulate to a darker color.

My problem is that when I put a ‘flashlight’ effect on the screen, the healthbar clips off at full brightness since it uses a pointlight2d to make the section of the healthbar that flies off visible.

This is fine when the flashlight effect doesn’t exist, but I’d prefer if it could be lit up by the first pointlight2d while still being dimmed by the canvasmodulate.

There’s a very easy workaround I can use by replacing the canvasmodulate and pointlight2d with a sprite of the below picture… but I worry about sweeping the problem under a rug instead of fixing it.
image