Since it won’t let me post in engine reports I’ll post here.
There is no documentation that this is intended so I’ll assume it’s a bug.
When you create a weld constraint and weld parts not in workspace, it’ll determine which of the parts should be the root part and set the CFrame of non-root part to the root part. It should not change the CFrame at all.
This happens in Studio and in game online.
Same weld function but welded outside of workspace:
In this case the Ball is the default root so everything gets moved to it.
Same as above with the black cylinder as root:
Everything is moved to where the black Cylinder was.
Here is a Repo place: DrTest.rbxl (23.4 KB)
The weld Script is in ServerScriptService. For those not wanting to download the place:
print("Hello World!") --Simple way of changing the RootPart of all models local CollectionService = game:GetService("CollectionService") for _,model in ipairs(CollectionService:GetTagged("TestModels")) do for _,modelDes in ipairs(model:GetDescendants()) do if modelDes.Name == "Cylinder" then --modelDes.RootPriority = 127 --(un)comment line to see change end end end --does the welding local function weldModel(model) local p0 = model.PrimaryPart or model.Part for _,p1 in ipairs(model:GetDescendants()) do if not p1:IsA("BasePart") then continue end local weldCon = Instance.new("WeldConstraint") weldCon.Part0 = p0 weldCon.Part1 = p1 weldCon.Parent = p1 end end --welds and clones models into workspace local redwork = game.Workspace.RedWork weldModel(redwork) local greenrep = game.ReplicatedStorage.GreenRep weldModel(greenrep) greenrep:Clone().Parent = game.Workspace local yellowscript = script.YellowScript weldModel(yellowscript) yellowscript:Clone().Parent = game.Workspace local purpserv = game.ServerStorage.PurpServ weldModel(purpserv) purpserv:Clone().Parent = game.Workspace
To recreate on your own:
- Make model and put parts in it
- Copy model, move it over a little, and put anywhere but Workspace.
- Weld everything together using script or by hand while model is not in workspace.
- Move or Clone back to Workspace
Note: Does not have to be in a model