Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to create a rope constraint between two objects with a script?

Asked by 2 years ago

If the two objects are called Part1 and Part2, how do I create a rope constraint between them with a script?

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Instance.new should make two attachments in these parts,Change the references in the script but i think it will work, this script will make two attachments in the parts and set the attachments in the Rope-Constraint, i hope this script helps

-- Creates rope Constraint
local Rope = Instance.new("RopeConstraint", game.Workspace.Part1)

-- Creates Attachments
local Attachment0 = Instance.new("Attachment", game.Workspace.Part1)
local Attachment1 = Instance.new("Attachment", game.Workspace.Part2)

-- Sets the Attachments of Rope Constraint
Rope.Attachment0 = Attachment0
Rope.Attachment1 = Attachment1

-- Makes it visible
Rope.Visible = true
0
Thank you, this script works. ViktorRamstrom 15 — 2y
Ad

Answer this question