It seems it doesn't like stairs. The resurouces get higher in places like this. I tried to make with rectangles with box colliders but seems not help. So far I came up with something like a solution(I don't like it much), I make a separate collider for the light like with spikes to the points of stairs. But at least it works faster that way.
Maybe there is a better solution for situations like this?
P.S.
Amazing script anyway.