Light Occluder 2D sometimes would not affect tiles from TileMaps

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By godotnoobperson

I’m not sure if this is a bug or I’m just missing something. This is in 2D:

I have a light set up that moves with the player. Then, I have light occluders which should block the sight of the player.

Sometimes, the occluders would not casting shadows on tiles on a TileMap. Note that this does not happen while the game is running but after the play button is pressed. It seems some hidden variable is changed which triggers this. Note also that shadows are still cast on sprites. And no, I did not change anything in the project (Play > Check shadows > ok > close > Play > Check shadows > suddenly not ok).

This happens for all TileMaps in the scene

I’ve also observed that if I change the light mask of one of the TileMaps. Then change it back to where it was, sometimes, the shadow casting is fixed.

I’m thinking of using a blank sprite to get around this but maybe I am just missing something.

Is this a bug? What could I possibly be doing wrong?