I have a little airport. I like a airplane to drive or move around there. I tried:
1 | for i = 1 , 500 do |
2 | Airplane.Position = Airplane.Position + Vector 3. new( 0 , 0 , 5 ) |
3 | wait( 0.01 ) |
4 | end |
& a tutorial by Roblox using BodyPosition
But these only works with parts/unions for me. How do I smooth move a whole model?
Use CFrame instead of position, and use the Set/GetPrimaryPartCFrame method available to models:
1 | local speed = 0.05 -- You want a number much lower than 5 studs because you move it 30 times every second! |
2 |
3 | for i = 1 , 500 do |
4 | local currentCFrame = Airplane:GetPrimaryPartCFrame() |
5 | Airplane:SetPrimaryPartCFrame( currentCFrame*CFrame.new( 0 , 0 , speed) ) |
6 | wait() |
7 | end |
The blog has two good articles on what CFrames are and how to use them: