How come I can't add a hair accessory to my humanoid?

local dummy = workspace:WaitForChild(CharSelectDummy)
humanoid = dummy:WaitForChild(Humanoid)

local style = player.PlayerGui.CharCreationScreen.FeatureFrames.Holder.HairScrollingFrame.ViewportFrame1.Hair:Clone()
			style.Parent = dummy
			humanoid:AddAccessory(style)

Error:

AddAcessory failed: Accessory is already being worn by another character.  -  Studio

From what I’m seeing here you are already parenting the hair to the dummy, making the hair already be a part of the dummy and making AddAccessory error out since the accessory is already in a character.

Oh, I thought AddAccessory was some function that aligns all the CFrames together.

How do I simply add a hair mesh or hat to a humanoid? Do I need to manually do all the CFrames/welding? I thought that was what this AddAccessory function was for, to do that for you.

remove this line and try it again

No such luck, it just starts falling down below the baseplate

Nope. You can give a character an accessory by either parenting it to the character or by using AddAccessory(). And yes, it does put the hair automatically IF the handle and the head have the “HairAttachment” instance inside of them.

image

Both the hair and the hat have those attachments

https://gyazo.com/8c16fa3f4c4d4f26cf9543e4a8aa52db

The hair just falls down

Rename the second Hair (the one inside the accessory) part to “Handle”.

1 Like

Thanks!

////////////////////////////////////////////////30

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.