I was wondering if I could somehow weld and position a hat to a players head? I have set up a function for cloning the hat and parenting it to the player, but I do not know how to weld and position it.
As always I looked for answers on the web and devforum, but found nothing.
Please!
No entire scripts, and thanks to any help I can get!
Try using Humanoid:AddAccessory(accessory), where accessory is your hat’s handle parented to the accessory object. Don’t forget about adding attachments to the hat.
Could you screenshot what the hierarchy of your hat model looks like? I’m theorizing you could just switch the model instance out for an accessory instance and it would still be the same hat, then you could just use @Operatik’s method.
how many attachments would you need for the hat, would it depend on the amount of parts you have inside the model because it still does not attach to the face?
Just use accessories and attachments. Your hat is automatically positioned according to where the attachment is, as attachments are lined up. If you’re editing in Studio, changing the position of the attachment actually changes the position of the item being welded since accessory welds are rigid.
If you absolutely need to weld a model, the easiest way is to make an invisible clone of a limb, weld your parts to that and then weld the pseudo limb to the real limb. Use WeldConstraints. You use an extra instance but I prefer this over trying to figure out positions with math.
Literally just weld everything in your model and put it into your accessory. From there you can position it accordingly.
Keep in mind that I find accessories are often extremely glitchy when it comes to position. It’s not uncommon for your entire model to glitch out when parented to a character. This could be why you’re having unwanted results.