After following this tutorial:
And getting a scene similar to the on in the video's description, I noticed that at a certain point, the lights stopped lighting up the tilemaps and/or sprites.
I tested the bug in the tutorial video's scene via putting in this bit of code in place of light_mask_tutorial.gd 's _input function:
func _input(event):
if event is InputEventKey:
if event.keycode == KEY_ESCAPE:
get_tree().quit()
if event.is_pressed() and event.keycode == KEY_SPACE:
tile_map.visible = !tile_map.visible
# Add torch
var torch = Sprite2D.new()
torch.texture = load("res://icon.svg")
torch.scale = Vector2(0.1, 0.1)
var new_object_light = PointLight2D.new()
new_object_light.texture = GradientTexture2D.new()
new_object_light.texture.fill = GradientTexture2D.new().FILL_RADIAL
new_object_light.texture.fill_from = Vector2(0.5, 0.5)
new_object_light.texture.gradient = Gradient.new()
new_object_light.texture.gradient.offsets = [0, 0.6]
new_object_light.texture.gradient.colors = [Color.WHITE, Color.BLACK]
new_object_light.blend_mode = Light2D.BLEND_MODE_ADD
new_object_light.energy = 1
new_object_light.texture_scale = 5
new_object_light.shadow_enabled = true
torch.add_child(new_object_light)
torch.position = player.position
player.get_parent().get_node("LitViewViewport").get_node("LitView").add_child(torch)
To test out when the lights stop rendering ^
Also I removed all the original nodes in the LitView scene's Lights node.
After adding the 15th light - the new ones just light up themselves and nothing else.
Does anyone know If I could make it so that only the nearest 15 lights work and the rest become static somehow or if there's a setting to increase this number.
Note: I noticed that if the player spawns the lights far away enough, they light up a split off part of the viewport again, however at a certain point, the lights stop lighting up anything again.
EDIT: Found this: