Issue with Humanoid:AddAccessory

The problem is simple, when I add an accessory to a non-player humanoid, it doesn’t add it. I have tried parenting it to the Model, that also does not work.

How my script works:

My script works by looping through the Children of a model, it then checks if the child is an Accessory, if it is then it runs the following:

local Accessory = v:Clone()
game.Workspace.MorphSystems.MorphDisplay.Humanoid:AddAccessory(Accessory)

From looking through whats happening, I’ve found the following:

  1. The accessory is added, but it doesn’t move to the the attachment.
  2. When it is added to a player, it works perfectly, moves to the attachment.

Any help or suggestions would be greatly appreciated!

2 Likes

Hey, I stumbled upon this problem just now and don’t know how to fix it, the accessory will simply not move to the attachment and I find that frustrating, if you found a fix for it I would appreciate that.

The engine snaps accessories together using the attachments for locational data, it will not do that automatically. Use this code if you want the attachments to snap together the same way it does for the accessories you wear from the website:

local accessoryWeld = Instance.new("Weld")
accessoryWeld.Name = "AccessoryWeld"
accessoryWeld.Part0 = YOUR_ACCESSORY_HANDLE
accessoryWeld.Part1 = LIMB_TO_ATTACH_TO
accessoryWeld.C0 = accessoryWeld.Part0.ATTACHMENT_NAME.CFrame
accessoryWeld.C1 = accessoryWeld.Part1.ATTACHMENT_NAME.CFrame
accessoryWeld.Parent = accessoryWeld.Part0

EDIT 12/03/2021: Use RigidConstraints to snap accessories together by their attachments instead.

2 Likes

Only 10 months late, but thanks for the solution.

1 Like