so i am trying to weld this model on to my characters right hand. but when i spawn all the parts are separted. here is the script
local rp = game.ReplicatedStorage local dark = rp:WaitForChild("Right Hand") game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("RightHand").Transparency = 1 local ClonedRH = dark:Clone() ClonedRH.Parent = character ClonedRH.Main.CFrame = character:WaitForChild("RightHand").CFrame local Weld = Instance.new("Weld") Weld.Part0 = ClonedRH.Main Weld.Part1 = character:WaitForChild("RightHand") Weld.C0 = CFrame.new() -- i dont know what to put here can someone help me Weld.Parent = character:WaitForChild("RightHand") end) end)
here is what happens https://media.giphy.com/media/kBw3AivfsOVP7deGHk/giphy.gif the rest of the parts are far away from the right hand ignore everything except line 15
In the gif a part is stuck to your right hand, I assume its the "main" part. If this is a model, you can set the primaryPart of it to the main, then do:
ClonedRH:SetPrimaryPartCFrame(character:WaitForChild("RightHand").CFrame)
This will move the whole model to the hand. I assume all parts are already welded together in the model, if not you could do a for loop to weld each part with the main part.
I’m going just going assume this is a tool. You have to weld the model / tool together or it will fall apart like that. I’d recommend welding it together outside of a script, but you could do it either way. A good way to weld everything together prior would be to use the moon animator plugin, at least that’s what I liked to use.
Anyways, hoped this helped, let me know if it didn’t.