How do I stop my CFrame Lerping from flinging the plane?
As you can see in the video, the plane is flinging when it moves:
Code: (ran on heartbeat)
01 | const delta = (tick() - this.delta) / this.speed; |
04 | const position = new CFrame(this.path [ 0 ] .CFrame.Position).Lerp( |
05 | new CFrame(this.path [ 1 ] .CFrame.Position), |
08 | const orientation = this.plane.Move.CFrame.sub(this.plane.Move.Position).Lerp( |
09 | this.path [ 1 ] .CFrame.sub(this.path [ 1 ] .CFrame.Position), |
12 | const pivot = position.mul(orientation); |
13 | this.plane.PivotTo(pivot); |
15 | if (this.path.size() > 2 ) { |
yes the code is in roblox-ts, but it'll be the essentially same in lua (with the except of the .sub macro compling to just a -
)