Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How do I fix ropes teleporting parts to themselves?

Asked by
Raccoonyz 893 Donator Moderation Voter
8 months ago
Edited 8 months ago

Hi. I'm making a script that adds a rope to any unanchored objects that come by. I want the rope to make the unanchored object swing across. However, whenever I try to do it the rope just teleports the part to the position without swinging it. That isn't what I want it to do and so I was curious how to fix this. My script:

local part2 = script.Parent
local attach2 = script.Parent.Parent.Conrope.Attachment
local conrope = script.Parent.Parent.Conrope

local function onModelTouched(part)
    if part.Name == "Part" then
 local attachment = Instance.new("Attachment")
 attachment.Parent = part
 local rope = Instance.new("RopeConstraint")
 rope.Parent = conrope
 rope.Attachment0 = attach2
 rope.Attachment1 = attachment
 rope.Restitution = 0.5
 rope.Length = 5
 rope.Visible = true
wait(5)
rope:Destroy()
attachment:Destroy()
end
end
part2.Touched:Connect(onModelTouched)

Answer this question