I’m asking this question because I am currently making a character customization for my game. There is a rig in workspace that is NOT the player’s character. It is more or less a dummy positioned in a room for players to add accessories too and try out outfits etc
Anyways, simply parenting accessories OR using humanoid:AddAccessory() does not work for some reason. The accessories just end up somewhere far away.
Before anyone asks, yes, the attachments are set up fine.
This brings me to my final question, how can I manually attach the accessories? I know there are some offset properties and what not, so I’d love to figure out how to incorporate that.
TLDR; How does the humanoid:AddAccessory() function actually work / how can I replicate the behavior of the function in my own code?
I know this topic was posted a few days ago by someone else but the answer given was a method that would be very time consuming + tedious.
Well, I found the issue. An accessory weld is never created. I would manually create one in the script but then the hat wouldn’t be offset correctly, right?
My current code:
local handle = object:WaitForChild("Handle")
object.Parent = workspace
rig:WaitForChild("Humanoid"):AddAccessory(object)
local accessoryWeld = handle:WaitForChild("AccessoryWeld")
accessoryWeld.Part1 = rig:WaitForChild("Head")
That solution actually worked pretty well! The only problem is that my hats and hairs are floating. I still don’t really get why but I assume that the offsets aren’t taken into account. Thats still what I need to figure out
I’ve seen this solution but I would much rather do this using a script instead of having to manually do each accessory. I just need to figure out how to offset the hat from when it gets positioned relative to the attachments.
good luck then, roblox pretty with locally adding accessories and hats
but hey if you find a solution let us know
EDIT 2023: If anyone reads this, this is NOT the proper way to do this. do not waste your time with the above, you’re going to have to use client-server communications, the server must applyaccessory to the VPF humanoid, follow what I stated here:
I have now realized that I am incredibly dumb; I was welding the handle of the hat to the handle of the hat (causing it to just rest on top of the head making it look like it floats). The offsets are done for me. Thank you so much for this resource!