Hello once again, i’ve recently come across a weird problem with collectionservice when making these moving platforms, only one of them actually work and move around, the other one stays at its place, i’ve tried duplicating them and even with 4 only ONE works, and i have absolutely zero idea what it could be, i used this for stuff like raising platforms using tweenservice and it has worked completely fine.
image for reference:
script:
local collectionservice = game:GetService("CollectionService")
local moving = collectionservice:GetTagged("moving")
for _, plat in pairs(moving) do
local waittime = plat.Value.Value
local p1 = plat.Parent.p1
print(plat.Parent)
local p2 = plat.Parent.p2
local ap = plat.AlignPosition
local rope = Instance.new("RopeConstraint", p1)
rope.Visible = true
rope.Color = BrickColor.new(0, 0, 0)
rope.Attachment1 = p1.rope1
rope.Attachment0 = p2.rope0
local distance = (p1.Position - p2.Position).Magnitude
local velocity = distance / waittime + distance / waittime
local pattach = p1:FindFirstChild("Attachment")
ap.MaxVelocity = velocity
while true do
pattach.Parent = p2
task.wait(waittime)
pattach.Parent = p1
task.wait(waittime)
end
end
Any help is appreciated.