Well, then it depends. Basic principle to move the whole model is with model:TranslateBy(Vector3) or model:SetPrimaryPartCFrame(CFrame).
I recommend the latter, since you have finer control over where exactly the train is.
How you want to handle smoothly moving it is up to you, but the basic principle is:
local function LerpModelTo(model, endCFrame, time)
local startCFrame = model:GetPrimaryPartCFrame();
local startTime = tick();
while true do
local a = (tick()-startTime)/time;
if (a>1) then break; end
model:SetPrimaryPartCFrame(startCFrame:Lerp(endCFrame, a));
wait();
end
model:SetPrimaryPartCFrame(endCFrame);
end
, and then to call that when you want to move the model. There's fancier stuff you can do to allow the animation to be interrupted, to base it off of speed rather than time, etc. but I'll leave that as an exercise for the reader lol |