How to attach model to players head

I have a custom model for a head and want to replace the players head with this head. I tried weld contraints but it didn’t work. They were all welded to a cube in the middle of the head of the model, then I welded that to the head, but it didn’t work.

Script That I tried to use:

local touched = false
script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid') and touched == false then
		touched = true
		local clone = game.ReplicatedStorage.Characters.JawTItan.JawTitan:Clone()
		clone.Parent = hit.Parent
		local weldcontraint = Instance.new('WeldConstraint', hit.Parent.Head)
		weldcontraint.Part0 = weldcontraint.Parent
		weldcontraint.Part1 = clone.PrimaryPart
		clone.PrimaryPart.Position = hit.Parent.Head.Position
	end
end)

image
image
the hrp cube is supposed to be positioned in the players head.

Thanks for the help!

Maybe try Motor6DS and position the Motor to fit the head.

You use Motor6Ds for this.

@DasKairo @hasoco

I have no idea how to do this, I’ve never in my life used motor 6d’s and I don’t even know what they are.

Hope this helps

This looks like it would only work on 1 part. How would I make it work on the model?

It works on the model also… I’ve used M6Ds for armors.

Just connect all of the parts within the model using welds to the main part and then create a motor6D within the main part that is linked with the head

local touched = false
script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid') and touched == false then
		touched = true
		local clone = game.ReplicatedStorage.Characters.JawTItan.JawTitan:Clone()
		clone.Parent = hit.Parent
		local weldcontraint = Instance.new('Motor6D', hit.Parent.Head)
		weldcontraint.Part0 = weldcontraint.Parent
		weldcontraint.Part1 = clone.PrimaryPart
		clone.PrimaryPart.Position = hit.Parent.Head.Position
	end
end)

Do you think this will work? The model is welded like this
image

Have you tried it? I think that would work, but I have no clue.

Yes, it works very well, its just the positioning is off, how would I change this?
image

Try playing around with it in the explorer.

Have you tried messing with the C0 position or C1 position?

Is there a way I could do this script wise? I don’t understand what you mean

I would but I don’t understand how it will work. Let me go mess around with it then real quickly.

It just acts like an offset position from what I know. Its how animations are run using them.

What would it use? CFrame or Vector3?

Vector3 because it’s only changing the position

I got this error, what did I do wrong?
weldcontraint.C1.Position = Vector3.new(1, 1, 0)

image

Oh, just change the entire C1. It should be a CFrame though because it has position and rotation combined.
Just don’t add a rotation.