**EDIT: I fixed my problem by defining the CFrame
s using quaternions, instead of two Vector3
s.
So, I am attempting to make a tsunami. It changes position using lerp. Simple enough, yes?
I got both of the CFrame
s by positioning the 'tsunami' part, then using the command bar to return their CFrame
s.
The lookVector
stayed the same through every position change - yet during the lerp, the part did a full rotation on the X axis, and a bit on the others.
--// v3 and cf have been defined as Vector3.new and CFrame.new --// All other variables have been defined local startC,endC = cf(v3(-1322, -40, 7),v3(1, -0, -0)),cf(v3(800, -40.5, 7),v3(1, -0, -0)) local startPos,endPos = startC.p,endC.p local magnitude = (startPos-endPos).Magnitude local step = 1/magnitude local hold = 1/tsunamiTime --// Also, if anyone could boost my memory on how to calculate this, that'd be great! for i = 0,1,step do part.CFrame = startC:lerp(endC,i) print(i) wait(hold) end
Thank you!
~TDP