So over the last couple days I’ve attempted to make a simple Lerp Module as a community resource and I’ve came upon an error. In the Output you get no message at all.So what’s happening is when I’m trying to test the module from a normal script the lerp doesn’t work in the intended way. The part stays at the start goal and then automatically teleports to the end goal.
Here is my Module’s code:
local LerpModule = {}
function LerpModule:SmoothCFrameLerp(PartToLerp : PVInstance, GoalCFrame : CFrame, TimeBeforeLerp : number)
wait(TimeBeforeLerp)
for i = 0,1, .01 do
PartToLerp.CFrame = PartToLerp.CFrame:Lerp(GoalCFrame, i)
end
end
function LerpModule:SmoothColorLerp(PartToLerp : PVInstance, GoalColor : Color3, TimeBeforeLerp : number)
wait(TimeBeforeLerp)
for i = 0,1, .01 do
PartToLerp.Color = PartToLerp.Color:Lerp(GoalColor, i)
end
end
function LerpModule:SmoothPositionLerp(PartToLerp : PVInstance, GoalPosition : Vector3, TimeBeforeLerp : number)
wait(TimeBeforeLerp)
for i = 0,1, .01 do
PartToLerp.Position = PartToLerp.Position:Lerp(GoalPosition, i)
end
end
function LerpModule:SmoothOrientationLerp(PartToLerp : PVInstance, GoalOrientation : Vector3, TimeBeforeLerp : number)
wait(TimeBeforeLerp)
for i = 0,1, .01 do
PartToLerp.Orientation = PartToLerp.Orientation:Lerp(GoalOrientation, i)
end
end
return LerpModule
Thanks for all help. All help is appreciated. Thanks!
Tomroblox54321