As the title explains, no matter what I do with the welds (i have swapped the order numerous times) the player is welded directly onto the model.
I made the model not anchored and removed collisions, but any time I edit that either the same problem arrives.
Here is the code:
local player = game.Players.LocalPlayer
local guy = workspace.guy
local character = player.Character or player.CharacterAdded:Wait()
for i, v in pairs(guy:GetChildren()) do
if v:IsA("MeshPart") or v:IsA("Part") then
local awesomeWeld = Instance.new("WeldConstraint", v)
awesomeWeld.Part0 = v
awesomeWeld.Part1 = guy.PrimaryPart
end
end
task.wait()
guy:PivotTo(character.PrimaryPart.CFrame)
task.wait()
local weld = Instance.new("WeldConstraint")
weld.Part0 = guy.PrimaryPart
weld.Part1 = character.PrimaryPart
weld.Parent = guy
guy.Parent = character
This worked, but then the model gets deleted after a few seconds, I assume part of this is because on top of being welded, it is probably constantly falling as well
Your script is a local script, so the weld is only being created on the client. Generally, when you want to weld something to the player that exists on the server (i.e. not a local part), you have to create the weld on the server and let it replicate to the client. Otherwise, the part’s not actually welded on the server so it can fall out of the world and despawn, which will replicate to all clients.