Large Model Movement?

I want to make a moving road that is 250 studs. The player is inside a bus to make the illusion of the bus moving.

Whenever I do this using:

while true do
for i= 1, 50 do
X:TranslateBy(, 0, -0.5))
for i= 1, 1 do
X:TranslateBy(, 0, 25))

There are too many parts and it gets laggy. How can I not make it laggy?

I’ve tried looking for the answer here and on youtube and found nothing. Maybe It could be that just the bus moves but then there would have to be a script that doesn’t make the player slide off every time it moves.

You can try use Model:SetPrimaryPartCFrame. But for that your model will need have a PrimaryPart.

while true do


Yea but you might add a wait on your loop. Like 1 second.

Make a wait(1) maybe thats gonna move part for 1 sec but you can change it to .5 too

while true do
wait (0.4)

i used this, i dont know why but it didnt work.

You need define CFrame.


You gotta calculate the CFrame to make it work. Example:

local PrimaryPart = script.Parent.PrimaryPart
local CF =,PrimaryPart.Position.Y,PrimaryPart.Position.Z) +,0,5)

You’re not using SetPrimaryPartCFrame() properly.

local run = game:GetService("RunService")
local origin = script.Parent.PrimaryPart.CFrame
local direction =, 0, 1)
local rate = 1 -- studs/second
local start = time()
while true do
    local t = time() - start
    script.Parent:SetPrimaryPartCFrame(origin + (direction.Unit * t * rate))

Or alternatively, instead of using the while-loop:

    local t = time() - start
    script.Parent:SetPrimaryPartCFrame(origin + (direction.Unit * t * rate))
1 Like

ok this works but how can i change the speed it does it at? Changing wait time is possible but if i set it to 0.00000000000000000000000000000000000000000000000000005 it still goes slowly

Just change the vector3 in this line:

local CF =,PrimaryPart.Position.Y,PrimaryPart.Position.Z) +,0,5) -- Change the 5 to what number you want.

OH THANKSSS but how can i make it go to a coordinate every 50 studs or so, i know how to make it go to a coordinate but how do i add a wait to it

If you need to make it start and stop at specific locations instead of move constantly you might want to use TweenService

oh also, how can i add the smoothness? like i want it at 60 studs per second but make it smooth so it doesnt just look laggy.

nvm now im back to my original problem. it just looks laggy.

looked fine in run but when i play it its laggy

The Stepped event of RunService fires once every frame in the server’s physics simulation. Assuming you haven’t changed other parts of the script (like adding a wait(1) where there shouldn’t be) it might be the lag from the game itself, not the script.

The reason it looks laggy is because you’re probably animating it on the server, not the client. No matter how well you animate it on the server, it’s going to look stuttery, because the network is not perfectly consistent, some packets of information take slightly longer or shorter times to arrive, or even occasionally get lost and have to be resent doubling the delay.

Basically, you have to do this from a localscript for it to work well.