Welding and positioning issue

Hi all,

I’m attempting to clone a model, position it on top of a part, and weld it to said part. This part would move, hence why I am attempting to weld them together. My issue is, with the current code, the model positions properly, but just falls through the floor after. The primary part is fine, that welds properly, but I don’t think anything else in the model is welded to the primary part, so they all just fall down and out of the world.

Any suggestions?

Code
module.GenerateItemModel = function(player, plot) --- something aint right
	local randomItem = rarityModule:PickRandomModel(itemFolder)
	if not randomItem then return end
	randomItem.Parent = plot:FindFirstChild("ElevatorItemHolder")
	
	for x, a in ipairs(randomItem:GetChildren()) do
		if a.Name ~= "GoesHere" and a:IsA("BasePart") then
			a.Anchored = true
		end
	end
	
	local rootPartWeld = randomItem.RootPart:FindFirstChild("WeldConstraint")
		or Instance.new("WeldConstraint", randomItem.RootPart)
	rootPartWeld.Part0 = randomItem.RootPart
	rootPartWeld.Part1 = randomItem.FakeRootPart
	
	local goesHereWeld = randomItem.GoesHere:FindFirstChild("WeldConstraint")
		or Instance.new("WeldConstraint", randomItem.GoesHere)
	goesHereWeld.Part0 = randomItem.GoesHere
	goesHereWeld.Part1 = randomItem.RootPart
	
	randomItem:PivotTo(plot.GoesHere.CFrame)

	local weld = Instance.new("WeldConstraint", randomItem.GoesHere)
	weld.Part0 = randomItem.GoesHere
	weld.Part1 = plot.GoesHere

	local hasSent = Instance.new("BoolValue", randomItem)
	hasSent.Name = "HasSent"
	hasSent.Value = false
	
	task.wait()
	
	for x, a in ipairs(randomItem:GetChildren()) do
		if a.Name ~= "GoesHere" and a:IsA("BasePart") then
			a.Anchored = false
		end
	end
end
----- rest of code, irrelevant
2 Likes

You have to make sure that everything in the model is welded to the primary part, because the script only creates 3 welds, you can do it manually or creating a loop that goes through all the parts of the model and welds them to the other part.

1 Like

Okay, I’ve done this and still no use.

Screenshot

Here’s the welding setup, each weld is connected to a different part in the model:

Would the Motor6Ds effect it at all?
image

1 Like

No, but you would just want to weld the objects to your primary part or however you want the parts joined together.

That’s what I have done, “GoesHere” is the primary part.

From past experience, using WeldConstraints messes up the constraint of two parts. I usually use Welds instead, tell me if i’m wrong

That just messes up the positions of the parts, moving them all into one position.

Example

Oh ok, my bad :brown_heart:

Can we see your more of your script for context?

That is the only part of the script relating to the model cloning, positioning and welding.

Question: is the part that you are welding the model to anchored or not?Welded parts falling - #19 and what are you trying to weld together like a player to an object…?

1 Like

what I use is a plugin called rig edit. it allows welding in place. which is very useful.

1 Like

I will try this out, thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.