Question about Tilemaps and Lighting

Godot Version

4.5

Question

So in my game I have a tilemap layer, and I want the rooms to be dark, while the player and some other objects are lit up. I accomplished this by having a CanvasModulate node in the Room scene, as well as a PointLight2D on the player and other lit up objects. However, I ran into the following problems:

  1. The walls don’t light up when the player (or another object with a light) stands next to them.

  1. When the player stands directly next to the wall, that section of the wall lights up while the rest of the light disappears.

Is there any way to fix those issues? I want the walls to be able to be lit up by the lights normally. How would I set this up?

Any ideas on this? I added a second tilemap layer node where I moved all the walls and the occlusion, and yet the problem still persists. I really don’t know what to do about this.

It may be related to masks. But still weird.

I advise you to create a ‘debug’ project where you only add the tilemap and the character and the light related functions where it works wrong, and share it on github, so we can maybe check what’s weird.

Otherwise, maybe someone else can figure out without that at some point later. Up to you.

1 Like