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


