Problem with moving models

G’day everyone, in my game I created a landscape that moves, it is made up of sectors that, once reached a certain distance, theyteleport back. Sectors are modules containing meshes and parts, with a script that moves them following the primary part. The problem is that after a few minutes of working they move away from each other. I don’t understand why, I tried searching the internet, I checked for various problems in the script, but found nothing. Anyone have an idea how I can fix them?

video
robloxapp-20220306-1301489.wmv (4.5 MB)

script

local model = script.Parent
local velocity = Vector3.new(-130,0,0)
while true do
local dt = wait()
model:SetPrimaryPartCFrame(
model.PrimaryPart.CFrame + velocity * dt
)
if model.PrimaryPart.Position.X < -5100.269 then
model:SetPrimaryPartCFrame( model.PrimaryPart.CFrame + Vector3.new(11480,0,0) )
end
end

2 Likes

i think you forgot to anchored them?

2 Likes

Thanks, but they are already anchored.

1 Like

is cancollide set to false?

1 Like

I did, but it still doesn’t work

1 Like