I’ve seen many topics about this issue but none of them had a solution.
I’m loading accessories into the game using InsertService:LoadAsset() and Humanoid:AddAccessory() to add them to the character. I expect the latter to also correctly position the accessories as I believe my rig fulfills all requirements.
From the docs:
This method attaches the specified Accessory to the humanoid’s parent.
When this method is called, an Accessory is attached to the character by searching for an Attachment in the humanoid’s parent that shares the same name as an Attachment in the accessory’s Handle Part. If one is found, the Handle part will be connected to the parent of the Attachment using a Weld, and the weld will be configured so the Attachments occupy the same space.
If the required Attachment can not be found, then the Accessory will remain parented to the humanoid’s parent but it will be unattached.
In particular: “When this method is called, an Accessory is attached to the character by searching for an Attachment in the humanoid’s parent that shares the same name as an Attachment in the accessory’s Handle Part.”
Both my rig’s head and accessory have an Attachment named “HairAttachment”, yet the hair accessory is not correctly positioned.
In case it matters, my rig is inside a ViewportFrame.
had same issue with my auto updating statue i had, here is what fixed it for me had to use a different method…
task.wait(1)
local AppModel = game.Players:GetHumanoidDescriptionFromUserId(userId)
Model.Name = game.Players:GetNameFromUserIdAsync(userId)
Model.Humanoid:ApplyDescription(AppModel)
end
I can’t use ApplyDescription because I’m not applying another character’s HumanoidDescription but rather adding single dynamically fetched accessories.
Due to you saying it’s in viewport, I understand that it’s running in local script. The problem is that accessories don’t work on client, you have to attach them manually
Typically, accessory welds are created on the server, but they can be created on the client under certain circumstances. In these situations, client-sided calls to AddAccessory() may not always produce the desired behavior and you can use BuildRigFromAttachments() to force the expected weld creation.
As @Sarlex0 and the docs say, positioning will fail on the client. To fix this it’s enough to add Humanoid:BuildRigFromAttachments() after Humanoid:AddAccessory().