Part Connected to Constraint Deleting Itself

I have a tool in my game that creates a part with an attachment and welds it to the mouse target, and then creates a rope constraint according to that attachment. The problem is, whenever the rope created by this script is connected to a dangling part, that part disappears after a few seconds.

There were no solutions to this that I could find, so any help would be greatly appreciated!

1 Like

This isn’t a Building Support topic.
It’s likely a script error that’s causing it.

When you test the Part is disappearing, but the rope looks like it’s still connected to it and swings in the same way.
Are you certain the Part is gone, or is it simply Transparent and you can’t see it?

In the Explorer tab, the Part deletes itself. The weldConstraint attached to it still exists, but it just randomly floats in the air
Screenshot 2025-04-14 064652
Also sorry about putting this in the wrong topic, I was unsure whether it was a script or physics error.

Please copy/paste the script here so we can take a look (or at least the sections that deal with this).
Put 3 backticks (```) before and after the script so it formats properly here.

1 Like

These are the 2 local scripts in the tool (the first script is called “one” and the second script is called “two”)

local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
local Player = game:GetService("Players").LocalPlayer

script.Parent.Activated:Connect(function()
	if Mouse.Target.Name == "spawn" then

	else
	local Part = Instance.new("Part")
	Part.Parent = workspace
	Part.Shape = "Ball"
	Part.Size = Vector3.new(0.15, 0.15, 0.15)
	Part.Transparency = 1
	Part.Name = "R"
	Part.CFrame = Mouse.Hit
	local weld = Instance.new("WeldConstraint")
	weld.Parent = workspace
	weld.Part0 = Mouse.Target
	weld.Part1 = Part
	script.Parent.Value.Value = Part.Position
	local Att = Instance.new("Attachment")
	Att.Parent = Part
	local Rope = Instance.new("RopeConstraint")
	Rope.Parent = script.Parent
	Rope.Attachment0 = Att
	script.Parent.two.Enabled = true
	script.Enabled = false
	end
end)
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
local Player = game:GetService("Players").LocalPlayer

script.Parent.Activated:Connect(function()
	if Mouse.Target.Name == "spawn" then

	else
	local Part = Instance.new("Part")
	Part.Parent = workspace
	Part.Shape = "Ball"
	Part.Size = Vector3.new(0.15, 0.15, 0.15)
	Part.Transparency = 1
	Part.Name = "R"
	Part.CFrame = Mouse.Hit
	local weld = Instance.new("WeldConstraint")
	weld.Parent = workspace
	weld.Part0 = Mouse.Target
	weld.Part1 = Part
	local Att = Instance.new("Attachment")
	Att.Parent = Part
	local Rope = script.Parent.RopeConstraint
	Rope.Attachment1 = Att
	Rope.Visible = true
	Rope.Length = (Part.Position - script.Parent.Value.Value).Magnitude
	Rope.Color = BrickColor.new("New Yeller")
	Rope.Parent = workspace
	wait(0.01)
	script.Parent:Remove()
	end
end)