you have to have a player entity assigned.. like player_walk_fight. Alternatively you can change the line where it says vec dist(my.x,player.x)>light_dist to this - vec dist(my.x,camera.x)>light_dist