✓ Accepted answer
Hello!
There is a scripting approach to this question, but also a non-scripting one. I'll write both just in case.
Non-scripting approach:
Alright so you have your model. Name doesn't matter. Put it in the StarterCharacter, make sure all parts within are unanchored. Create WeldConstraints that are inside each MeshPart in the model. In each one, set the properties Part0 to the StarterCharacter's head, and Part1 to the MeshPart that it's in. Position the model to the player's head, and you've got yourself a welded hat.
Scripting approach:
Put your hat in ServerStorage. Put the following code in a normal server script and put it in StarterPlayer>>StarterCharacterScripts.
hat = game.ServerStorage.Hat
hatHeightOffset = 0.3
hatClone = hat:Clone()
hatClone.Parent = script.Parent
hatClone:MoveTo(Vector3.new(script.Parent.Head.Position.X, script.Parent.Head.Position.Y + hatHeightOffset, script.Parent.Head.Position.Z))
local children = hatClone:GetChildren()
for i, child in ipairs(children) do
weld = Instance.new("WeldConstraint")
weld.Parent = child
weld.Part0 = child
weld.Part1 = script.Parent.Head
end
I really hope this helps you, I put alot of time into my answer. The code should work, because I just tested it in a blank studio project.
Also if this helps you please accept my answer so that I can get reputation for my effort.
Anyway, hope this helps, and enjoy! :D
--ProqrammedGreen
2 comments
thanks for the help
thanks