Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the lerp function not moving part2 too 0.75?

Asked by 2 years ago

local part = game.Workspace.P1 local part2 = game.Workspace.P2 function PartChange(player) task.wait(5) part2.CFrame = part.CFrame:Lerp(part.CFrame,0.75) end PartChange()

0
Format your code in a lua code block. WideSteal321 773 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Next time, please add more explanation to your description other than the title. To format your code to a code block, click the Lua button up between the Title and Description boxes. Clicking it should appear two lines of 17 tildes (~), in separate lines, and a blank line in between. In that blank line is where you paste your code.

Solution

You're trying to lerp part.CFrame to itself, which will always return part.CFrame. I think you were trying to lerp part2.CFrame instead of part.CFrame.

1local part = workspace.P1
2local part2 = workspace.P2
3 
4function PartChange()
5    task.wait(5)
6    part2.CFrame = part2.CFrame:Lerp(part.CFrame, 0.75)
7end
8 
9PartChange()
Ad

Answer this question