Conveyor Belt script has a high rate(/s)

I have multiple conveyor belts for my obby and it is really laggy, there are many moving parts. I’m the process of optimizing my game.

My conveyor script has a rate(/s), way higher than the second most.

Is my script efficient enough? I placed it in the part which is in the workplace.

while true do
script.Parent.Velocity = script.Parent.CFrame.lookVector *20
wait(0.1)
end

Is your part anchored? If so, you should only need to set the velocity once, as anchored parts will retain their velocity forever; the while loop is redundant. Additionally, if you are applying the same velocity to multiple parts it may be advantageous to iterate over them with a for loop to set the velocity of each with a single script.

2 Likes