I need help with this, I don't know how to combine lerp with SetPrimaryPartCFrame
for o=0,1,.01 do object:SetPrimaryPartCFrame(CFrame.new(0,0,0)) wait(.1) end
I'm trying to get a model(object) to slide to 0,0,0
First we get the original CFrame of the primary part then we setup the lerp like this
local cf = script.Parent:GetPrimaryPartCFrame() for i=0,1,.005 do wait() script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame():lerp((cf*CFrame.Angles(math.rad(90),0,0)),i)) end
That example was for rotating 90
This example is for moving to 0,0,0
for i=0,1,.005 do wait() script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame():lerp((CFrame.new(0,0,0),i)) end