Hello,
I would like to know how I would go about fading a light on and off. I have a bunch of lights inside a model and I need them all to fade on and off when I tell it to do so in a main script. I know that I would have to use a loop.
Thanks,
Anthony
To fade a Light, simply lower the Brightness gradually to 0.
You should probably use TweenService to gradually transition the Brightness to 0.
If you have a bunch of lights in a model, perhaps something like this could work:
local Model = MODEL_HERE -- Change to your model local TweenService = game:GetService("TweenService") local Goals = { Brightness = 0; } local Duration = TweenInfo.new(5) local Descendants = Model:GetDescendants() for a = 1, #Descendants do local Part = Descendants[a] if Part:IsA("Light") then TweenService:Create(Part, Duration, Goals):Play() end end
I wrote this on mobile, so I apologize if I messed it up. Good luck, though!