As you can see in the video below, the plane is flinging when it moves:
Code: (ran on heartbeat)
const delta = (tick() - this.delta) / this.speed;
if (delta < 1) {
print(delta);
const position = new CFrame(this.path[0].CFrame.Position).Lerp(
new CFrame(this.path[1].CFrame.Position),
delta,
);
const orientation = this.plane.Move.CFrame.sub(this.plane.Move.Position).Lerp(
this.path[1].CFrame.sub(this.path[1].CFrame.Position),
delta,
);
const pivot = position.mul(orientation);
this.plane.PivotTo(pivot);
} else {
if (this.path.size() > 2) {
this.delta = tick();
this.path.shift();
} else {
this.Destroy();
print("Done!");
}
}
yes the code is in roblox-ts, but it’ll be the same in lua (with the except of the .sub macro compling to just a -
)