I’m not super good with loops, but I figured I would give them a try, it didn’t work. Alright, so I tried a script that would make the brightness of a PointLight increment by .3, then once it was equal to nine, it would decrease by .3.
Here is my code, it is a Script:
local parent = script.Parent
for 1 == 1 do -- This is a forver loop, right? Idk why it wouldnt be
while 9 > parent.Brightness do
parent.Brightness = parent.Brightness+.3
if 9 < parent.Brightness then
parent.Brightness = parent.Brightness-.3
end
end
end
As @Ayphic pointed out, you can use tweens to increase the brightness smoothly, also you can take advantage of TweenService:Create() 5th parameter which makes the tween(animation) reverse:
local TweenService = game:GetService("TweenService")
local parent = script.Parent
--wait between each tween, easing animation, easing direction, repeats(infinity), reversing
local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, math.huge, true)
local tween = TweenService:Create(parent, info, {Brightness = 9})
tween:Play()