Hello devs of all shapes and sizes, I’ve very little experience in welding a model to a player’s default character hence I’m asking how one would go about doing it in terms of setting the weld to the exact position within the player, setting the c1,c0 properties and what not along with all the cframe junk to set it correctly in position.
I do however have worked on the model with it being welded on a dummy:
How would I transfer this onto a player’s character and still have it work accordingly? I want it welded to the player’s uppertorso in an upside-down position and have it protract from there as seen in the clip.
I’ve written a proto-script off the top of my head but I have no idea where exactly to go from here:
local Player = game:GetService("Players").LocalPlayer
Player.CharacterAdded:Connect(function(Character)
local UpperTorso = Character:WaitForChild("UpperTorso")
local Head = Character:WaitForChild("Head")
wait()
local Helmet = game:GetService("ServerStorage"):WaitForChild("WorkingHelmet"):Clone()
Helmet.Parent = Character
Helmet:SetPrimaryPartCFrame(Character.UpperTorso.CFrame)
local Weld = Instance.new("Weld")
Weld.Parent = Helmet.PrimaryPart
Weld.Part0 = Character.UpperTorso
Weld.Part1 = Helmet.PrimaryPart
end)
Some directions to set me on course would be nice and greatly appreciated, thanks in advance.
Assuming you wanted to weld it where the head is relative to the UpperTorso, you can use C0 and C1 from the Neck (Motor6D) since the head is also coincidentally attached to the UpperTorso. Neck is a child of the Head, by the way.
No, use a weld. Character assemblies are set up using Motor6D which is a joint, just like Welds and uses the same C0/C1 offset system for positioning body parts relative to one another. You can position your model where the head is relative to the UpperTorso by setting your weld’s C0/C1 to those of the Neck, which is of class Motor6D and is a child of the Head.
I don’t want to do it via the animation way. I have all the helmet tweening stuff done on a dummy, I simply have no idea how in the world to weld it on a live player and still have it funciton as intended. All the tutorials I’ve found all use custom models. And there’s barely any good text tutorials that can help me on the forum.
That’s why I’m recommending you use the Neck as a reference, its C0 and C1 would position your helmet exactly where the head is. From there you can tweak C0/C1 to move it up/down, left/right.
Since you already did this in studio doprint(Head.CFrame:ToObjectSpace(Helmet)) this will give you the offset of the helmet relative to the head. Now just do Weld.c0 = CFrame.new(offset)
Oh and to edit it with the way things are looking, It seems you are rotating the helmet, so get the pivot position of the helmet, rotate the pivot, and then update the weld.c1, this should move it.