Putting an accessory on a dummy?

Hi there, I’ve been trying to make a main menu for my game and in it put a copy of player’s character for display. I managed to make it display shirts, colors and face but I can’t seem to get it to show accessories. I tried using the humanoid:AddAccessory() function and also simply parenting it but in both cases the accessory was parented to the dummy but wasn’t visible.

I searched for a solution and best I could find is just welding it. However, I’d like to know if there is any simplier way to do that?

1 Like

For the majority of the time, that’s because of the anchored property on the dummy or the accessory. Make sure both aren’t anchored.

2 Likes

None of the parts in humanoid and accessory is anchored

Here’s the code btw

local dummy = background.CharacterDisplay
dummy.Humanoid:LoadAnimation(dummy:WaitForChild("Animation")):Play()

local character = player.Character or player.CharacterAdded:Wait()

local clonedClasses = {"BodyColors", "Shirt", "Pants", "ShirtGraphic", "Hat", "Accessory"}
function ProcessChild(child)
	if table.find(clonedClasses, child.ClassName) then
		local new = child:Clone()
		
		if child.ClassName == "Accessory" then
			dummy.Humanoid:AddAccessory(new)
		else
			new.Parent = dummy
		end
	end
end

for i,v in pairs(character:GetChildren()) do
	ProcessChild(v)
end
character.ChildAdded:Connect(ProcessChild)

-- Adding face
local face = character:WaitForChild("Head"):FindFirstChildOfClass("Decal")
if face then
	local new = face:Clone()
	new.Parent = dummy.Head
end```

make sure both the accessories and the limbs have the right attachments for AddAccessory to work

Accessories are cloned from player character so I assume they’ve got everything needed. I’m not sure what do you mean about limb attachments though.

These things are required to be properly named and added in place as accordingly:

Are you certain these exist?

Instead of cloning the players character, I would find it easier to have a blank dummy and apply all of the players accessories and clothes onto that dummy. You can get the players accessories easily using Players:GetCharacterAppearanceAsync(). Here is a link to the DevHub page for GetCharacterAppearanceAsync()

I’ve made a quick example script to demonstrate how I would do this, I have also provided a video of me using the studio command bar to run the script to demonstrate me putting my accessories and clothes onto a blank dummy.

Example Code:

local Players = game:GetService("Players")

-- Getting the UserId's appearance model
-- Testing using my UserId (you'd put the players here)
local Appearance = Players:GetCharacterAppearanceAsync(72822618)

-- Moving all of the objects in the appearance model to our empty dummy
local dummy = workspace.DevforumDummy
for k,v in ipairs(Appearance:GetChildren()) do
	local alreadyExists = dummy:FindFirstChild(v.Name, true)
	if alreadyExists then -- good for automatically parenting stuff like 'face'
		v.Parent = alreadyExists.Parent
		alreadyExists:Destroy()
		continue
	end

	v.Parent = dummy
end

Video:
https://streamable.com/t9kpmk

Hope this helps.

That’s what I’m doing

The problem is that accessories don’t get visible when I put them into the dummy. I see your script does the same thing except gets the accessory from a different source. Are you sure this would help?

Yes because you no longer have to use Humanoid:AddAccessory, and you aren’t cloning from the players character. It only returns the clothes, shirts, accessories and body colour for the player.

Acu, check the dummy model and make sure it has accessories like HairAccessory in the Head to pair with the HairAccessory in Hairs Accessories that you’re trying to add onto the dummy

you could get a copy of someone’s character model and pretty much copy and paste all the attachment accessories into the dummy

Well, I used your method but it didn’t help. The accessories are still in dummy but not visible.

Would HumanoidDescription thing work here maybe?

How do you create the dummy?
I used the dummy created from Plugins > Build Rig.

I used that too, it’s a normal r15 block rig.

I’ll see if I can do something with the attachments

Yeah, the dummy has all of these.

maybe you need to make all the stuff Archivable before trying to clone them? also, you’re not getting errors, right?

I don’t see how Archivable would help here. The accessories are cloned and parented properly, they just aren’t visible.

And no, there’s no errors. Everything gets put on the dummy properly except the accessories.

EDIT: I found something - the accessory is visible but for some reason it’s attached to the player character instead of dummy. I’ll see what I can do about this.

It’s fixed! I just had to change part1 property of the AccessoryWeld. Thanks for the help!

1 Like