I'm lerping the color property of a PointLight to make it blue, it worked until I added my while loop. How could I successfully stop the b value of a Color3 from going over 255? Any and all help is welcome.
wait(5)
function LerptoBlue()
for i = 0,1,0.000015 do
script.Parent.PointLight.Color = script.Parent.PointLight.Color:lerp(Color3.new(0,0,255), i)
wait()
while true do
if
script.Parent.PointLight.Color.b > 255 then
script.Parent.PointLight.Color.b = 255
end
wait(1)
end
end
end
LerptoBlue()

5 comments
It might be because your "for" loop won't ever be one. Because if you were to times 0.000015 to get 1, you'd get an odd number (66666.6667)
No. I think lerping accounts for this.
Just remove the while and the wait in the while. I see no point in it
Try doing "/255" after each color3 number. So "0/255,0/255,255/255"
Color3 values can't go over 255 (or 1).