Provide an overview of:
- What does the code do and what are you not satisfied with?
when I press the keypad e. Parts.CFrame from the dummy lerp to my parts on my character. when it lerps, it is not consistent in speed when moving to my character’s parts. For some reason there is a long unnecessary delay when lerping everytime I move my character. - What potential improvements have you considered?
I tried removing waits between the for loops but it is still slow. - How (specifically) do you want to improve the code?
I want to know how I could make the parts lerp quicker to their destination but in sections. So There is no long delay in between the For Loops and there is a short pause in between the lerping of the sections.
-- local diaclone = game.Workspace.diamondclone
for a = 0,1,.01 do
wait()
diaclone.LeftFoot.CFrame = diaclone.LeftFoot.CFrame:Lerp(LocalPlayer.Character.LeftFoot.CFrame,a)
diaclone.LeftHand.CFrame = diaclone.LeftHand.CFrame:Lerp(LocalPlayer.Character.LeftHand.CFrame,a)
end
for b = 0,1,.01 do
wait()
diaclone.LeftLowerArm.CFrame = diaclone.LeftLowerArm.CFrame:Lerp(LocalPlayer.Character.LeftLowerArm.CFrame,b)
diaclone.LeftLowerLeg.CFrame = diaclone.LeftLowerLeg.CFrame:Lerp(LocalPlayer.Character.LeftLowerLeg.CFrame,b)
end
for c = 0,1,.01 do
wait()
diaclone.LeftUpperArm.CFrame = diaclone.LeftUpperArm.CFrame:Lerp(LocalPlayer.Character.LeftUpperArm.CFrame,c)
diaclone.LeftUpperLeg.CFrame = diaclone.LeftUpperLeg.CFrame:Lerp(LocalPlayer.Character.LeftUpperLeg.CFrame,c)
diaclone.LowerTorso.CFrame = diaclone.LowerTorso.CFrame:Lerp(LocalPlayer.Character.LowerTorso.CFrame,c)
end
for d = 0,1,.01 do
wait()
diaclone.RightFoot.CFrame = diaclone.RightFoot.CFrame:Lerp(LocalPlayer.Character.RightFoot.CFrame,d)
diaclone.RightLowerArm.CFrame = diaclone.RightLowerArm.CFrame:Lerp(LocalPlayer.Character.RightLowerArm.CFrame,d)
diaclone.RightLowerLeg.CFrame = diaclone.RightLowerLeg.CFrame:Lerp(LocalPlayer.Character.RightLowerLeg.CFrame,d)
diaclone.RightUpperArm.CFrame = diaclone.RightUpperArm.CFrame:Lerp(LocalPlayer.Character.RightUpperArm.CFrame,d)
end
for e = 0,1,.01 do
wait()
diaclone.RightUpperLeg.CFrame = diaclone.RightUpperLeg.CFrame:Lerp(LocalPlayer.Character.RightUpperLeg.CFrame,e)
diaclone.UpperTorso.CFrame = diaclone.UpperTorso.CFrame:Lerp(LocalPlayer.Character.UpperTorso.CFrame,e)
diaclone.Head.CFrame = diaclone.Head.CFrame:Lerp(LocalPlayer.Character.Head.CFrame,e)
end
for f = 0,1,.01 do
wait()
diaclone.HumanoidRootPart.CFrame = diaclone.HumanoidRootPart.CFrame:Lerp(LocalPlayer.Character.HumanoidRootPart.CFrame,f)
diaclone.RightHand.CFrame = diaclone.RightHand.CFrame:Lerp(LocalPlayer.Character.RightHand.CFrame,f)
end