Color3:
function c3lerp(a, b, t)
return Color3.new(a.r + (b.r - a.r) * t, a.g + (b.g - a.g) * t, a.b + (b.b - a.b) * t)
end
CFrame:
function clerp(c1,c2,al)
local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
for i,v in pairs(com1) do
com1[i] = v+(com2[i]-v)*a1
end
return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
end
Please note that the function above is not 100% accurate to modern cframe lerp, consider it as a "legacy" option Here is a newer version that is more accurate (might not work with clients like 2012, havent tested)
Thanks to shrjrd for telling me this
Regular Numbers function lerp(a, b, t)
return a + (b - a) * t
end
function slerp(a, b, t)
dot = a.Dot(b)
if dot > 0.99999 or dot < -0.99999 then
return t <= 0.5 and a or b
else r = math.acos(dot)
return (a*math.sin((1- t)*r) + b*math.sin(t*r)) / math.sin(r)
end
end

