Having issue with 2D lighting in Godot

Godot Version

4.2.2

Question

I’m trying to make a flashlight for a 2D top down game. The light itself is going through the wall and I have no clue why this is happening, see video attached: https://youtu.be/GE2ryR9WpHs

When I get close to a wall, the light illuminates only one tile, and if I get even closer, it goes through it completely.

The flashlight itself is a PointLight2D and I’m using a tilemap with a light occlusion layer

it’s because your pointlight2d center is not on the player body or the flashlight tip, hence it looks like that
the source of the light is based on the center position of the pointlight2d. if it’s inside the wall, then yes it will only light the wall

1 Like

this helped! thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.