Is there a way to get the children of children?

What I’m trying to accomplish here, is when a remote event fires, all the surface lights inside of the lights folder turn to red. Could I do this with a normal GetChildren() or would there be another way?

image

You can use :GetDescendants().

@Towren EDIT

Me and AndroidBoyz posted at the same time. This is what we meant:

for _, object in pairs(workspace.Lights:GetDescendants()) do
	if (object:IsA("SurfaceLight")) then
		object.Color = Color3.new(255,0,0)
	end
end
3 Likes

You can use GetDescendants() , then check if the child is a SurfaceLight and if it returns true then change their colors.

2 Likes