Some help with Lerping

Does an object need to be anchored/unanchored for lerping?

Linear interpolation, or Lerp, simply returns a new value in between the given CFrame and the goal CFrame. For example, if you did something like this:

PartCFrame = workspace.Part.CFrame
GoalCFrame = PartCFrame*,10,0)

it would return a CFrame value equal to PartCFrame*,5,0) because the second parameter of Lerp was .5

Lerp simply returns a new CFrame value, and will not move an object. If you want to use Lerp to move an object set the CFrame of the part to the Lerped CFrame. (would not matter if anchored since you are just setting the CFrame)

1 Like

You also can use a ‘tweening’ motion for lerping.


local part = script.Parent
local TargetPart = game.Workspace.TargetPart

for i = 0,1,0.1 do -- 0 to 1 is the percentage of the way the part lerps to, example: 0.7 = 70%
    part.CFrame = part.CFrame:Lerp(TargetPart.CFrame,i)
1 Like