|
| 07 Apr 2016 08:49 PM |
Trying to get the grasp of lerp animations. For some reason this dose not do anything
x=CFrame.new(1.43356323, 1.26202965, -1.17901993, -0.533497512, 0.124998942, -0.836513937, -0.124999106, 0.9665066, 0.224143326, 0.836513937, 0.224143401, -0.500004113)
wait(3) while wait(.1) do game.Workspace.Head.Left_1.C0 = game.Workspace.Head.Left_1.C0:lerp(x,.02) end
I got the cframe from moving a duplicate of the piece that I was animating and used basepart.CFrame:toObjectSpace(newpieceCFrame)
Cant seem to get anything happening
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 08 Apr 2016 12:42 AM |
You need a step for it to Lerp, there are two methods I know of
A. for loop (Inefficient, I don't recommend it)
local Step = 0.1 for Iteration = 0, 1, Step do game:GetService("RunService").RenderStepped:wait() Part.CFrame = Part:Lerp(Target,Iteration) end
B. delta timing in a loop (More efficient and compensates for frame rate drops)
local delta = tick() local Speed = 8
while game:GetService("RunService").RenderStepped:wait() do Part.CFrame = Part:Lerp(Target,(tick()-delta)*Speed) delta = tick() end |
|
|
| Report Abuse |
|
|