Basically i make script builder stuff and now i am making a SB weapon and i want to know a less confusing way to animate frame by frame with CFrame. I know i dont have a script example i just wanna know how to do this.
if this isnt confusing
local part = workspace.Part for i = 0,1, 0.1 do part.CFrame = part.CFrame:lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)), i) end
You can make animations using the animation editor and convert them to CFrame format using this animation converter
If you're looking for a lerp function to make things easier/quicker:
function Lerp(c1,c2,al) local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()} local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()} for i,v in pairs(com1) do com1[i] = v+(com2[i]-v)*al end return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1))) end