WeldConstraints do not connect

Hi DevForum users!

I encountered a issue while trying to Weld a part to another.
For some reasson, when i create a weld via script and set both parts, weld still inactive, even when Part1 is unanchored, when i change to server side and try setting the Part1 to the same Part it suddenly works and weld is set to active, which dosent make any sense.

if not Player or not Object or not Tile then return end
	if Player:FindFirstChild("Coins").Value < Object:GetAttribute("Price") then return end
	Player:FindFirstChild("Coins").Value -= Object:GetAttribute("Price")
	Tile:AddTag("Ocuppied")

	local NewClone = Object:Clone()
	NewClone.Parent = Tile
	NewClone.PrimaryPart.CFrame = Tile.CFrame * CFrame.new(0,1,0)

	local Weld = Instance.new("WeldConstraint", Tile)
	Weld.Enabled = true
	Weld.Part0 = Tile
	Weld.Part1 = Object.PrimaryPart
	warn(Weld.Active)*emphasized text*

well I tested your script and it worked fine but here is some stuff that might be the problem:

  1. Object’s primary part is not set.
  2. Another script is making it unable to be enabled.
  3. A part changed in some way (it moving to another parent or it not existing anymore)

if its not any of these then idk :skull:
Good luck!

Nope, none of those happen, so i dont know either!
I am kind of stuck with this

Heres the code a little bit more complete:}


if not Player or not Object or not Tile then return end
	if Player:FindFirstChild("Coins").Value < Object:GetAttribute("Price") then return end
	Player:FindFirstChild("Coins").Value -= Object:GetAttribute("Price")
	Tile:AddTag("Ocuppied")

	local NewClone = Object:Clone()
	NewClone.Parent = Tile
	NewClone.PrimaryPart.CFrame = Tile.CFrame * CFrame.new(0,1,0)

	local Weld = Instance.new("WeldConstraint", Tile)
	Weld.Enabled = true
	Weld.Part0 = Tile
	Weld.Part1 = Object.PrimaryPart
	warn(Weld.Active)

Is the constraint patented to one of the two parts? Welds don’t work if not.

Yes, its parent is set to the Tile, and the model with the Part 1 is inside of it

Oof, my device didn’t let me see that without going Portrait mode.

I’ll test out some possible solutions to see what’s the issue.

Alright, thank you, tell me if you find or need anything!

Got back to this now, are you sure you wanted to make the Weld’s “Part1” the Object.PrimaryPart, or did you mean the NewClone.PrimaryPart?

Hahaha, yeah, i just went to take a shower and i was like, did i forget to set its part 1 to the clone instead of the stored model? hahaha.

It’s always when you take a break for a minute, you suddenly remember what you forgot. Glad you fixed it!

Yeah hahaha, i was just a lot of time just thinking in my computer and didnt worked haha.