Lighting

Why do the lights affect textures and other objects but not my player? The fan is an object and is illuminated by both the character’s and the ceiling’s lights. Both have the same light mask configuration, but the character isn’t affected…:man_shrugging:

Can you try to set the Z min range to -4096 and the layer max before the element with no illumination?

Also wonder if it’s the shader material blocking the light? Try removing the shader material and see if it works perhaps. I know you would want the shader material, but just incase to see if it’s causing it.

The first thing I tried before writing was the occlusion layer (obviously :sweat_smile: ). Then I played with the layers and it didn’t work either, nor did the z_indez. As I said before, the other object is illuminated by the character’s light and the ceiling light, but not my player. To darken, I’m using a Modulate Canvas because using the Visual Script Darkness filter darkens the screen but ignores the lighting. Both the fan and the character have z index 0 and z index relative activated and the same lighting layers.
The light ranges z min and z max are -1024 and 1024 respectively. In principle, everything is by default and should work. I changed the minimum and maximum layers to -200 and 200 and it doesn’t work. I tried what Baz said and it didn’t work either.

Can you send the project in so we can investigate it further?

When I have a hole, I will try to reproduce it in another basic project and if I still have a great time I will send it

「いいね!」 1

Thank you!

Well, here’s a project and a video about lighting. The player, in blue, moves from left to right using the pad or arrow keys. The enemy moves independently; both are created with their corresponding game object profiles. The object with an X is a game object created with the empty profile and is only decorated.
To darken the screen, I use a Canvasmodulated because the AGM DARKNESS filter darkens the screen but ignores the lights.
I don’t know if I’m doing something wrong or if it’s a bug.
By the way, no object has a light occluder except the tilemap.

Video: 30.68 MB folder on MEGA

light.zip (2,5 MB)

Thanks for the project.

If I check ‘Use Parent Material’ it seems to work:

Thanks, it worked. I think this option should be enabled by default, so things like this wouldn’t happen, or other things like the TakenDamageSettings function wouldn’t work. If that’s the way it should be for everything to work properly, it should be enabled by default, and we wouldn’t have to keep checking each object when creating it because these things are sometimes forgotten. This is the second time this has happened to me.:man_facepalming: :sweat_smile:

Makes sense, it’s off by default with Godot as well. We can see if there is a good reason why it should be off, if not then yea on by default would be preferred.