Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I smooth move a model?

I have a little airport. I like a airplane to drive or move around there. I tried:

for i = 1,500 do
	Airplane.Position = Airplane.Position + Vector3.new(0,0,5)
	wait(0.01)
end

& a tutorial by Roblox using BodyPosition

But these only works with parts/unions for me. How do I smooth move a whole model?

2 comments

1

weld it together and then move the main part of the weld (C0)

0

You can just do wait() instead of wait(0.01) , Also,the less you move it,the smoother it will be.

1 answer

✓ Accepted answer

Use CFrame instead of position, and use the Set/GetPrimaryPartCFrame method available to models:

local speed = 0.05 -- You want a number much lower than 5 studs because you move it 30 times every second!

for i = 1, 500 do
	local currentCFrame = Airplane:GetPrimaryPartCFrame()
	Airplane:SetPrimaryPartCFrame( currentCFrame*CFrame.new(0, 0, speed) )
	wait()
end

The blog has two good articles on what CFrames are and how to use them:

This discussion is preserved as it was. New answers, comments, and votes are closed.