Hey so i got the track to move how I want but how would I go about welding something to the parts that are moving? I tried to put a weld constraint to one of the moving parts and a separate part but the separate part doesn’t move.
also I have a gut feeling that this isn’t the best way to code this.. any tips would help tons
--config
local speed = .5
--functions
local function movePart(part)
if part.Position.Z < finalPoint.Position.Z then
part.Position = startPoint.Position
local tweenInfo = TweenInfo.new(speed, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local tween = TS:Create(part, tweenInfo, {Position = part.Position + Vector3.new(0, 0, -180)})
tween:Play()
else
local tweenInfo = TweenInfo.new(speed, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local tween = TS:Create(part, tweenInfo, {Position = part.Position + Vector3.new(0, 0, -180)})
tween:Play()
end
end
--code
script:GetAttributeChangedSignal("isMoving"):Connect(function()
while script:GetAttribute("isMoving",true) do
movePart(movingPart1)
movePart(movingPart2)
movePart(movingPart3)
movePart(movingPart4)
movePart(movingPart5)
movePart(movingPart6)
task.wait(speed + .001)
end
end)
I don’t think playing tween is good (players will see jittering moving floor because delayed replication), try use AlignPosition or something like motor6d (weldconstraint and etc)
Try using the Search tool up top and the term infinite road track. There have been quite a few posts about this topic in the past, most with good suggestions and solutions.