Hair don't go on the dummy head

Ciao, I’m trying to make a character creator by making the player choose the dummy hair in a gui.
The dummy is showed in a ViewportFrame. The player has to click the button with the wanted hair.

The script copies the hair and removes the ones that it had before, but it doesn’t put the hair on the head, and idk why.
Script:

local character = script.Parent.Parent.Parent.Card.ViewportFrame.Dummy.Dummy
local Buttons = {
	script.Parent.Table.Row1.A,
    --There are more ofcourse
}
local Hair = game.ReplicatedStorage.Armadio:FindFirstChild("0").Hair
--Gets where all the hairs are

function Cambia(N)
	local Hair = Hair:FindFirstChild(N):Clone() --Searches the right hair
	Hair.Name = "Hair"
	
	character:FindFirstChild("Hair"):Destroy() --Removes the hair the dummy had
	Hair.Parent = character --Gives the hair
end

Buttons[1].MouseButton1Click:Connect(function()
	Cambia(1) --Send which button got clicked
end)

Photo to show where they hair get put whenever they get parented to the dummy:
im67676age

I tried to search on google but i found nothing.
Thank you a lot :slight_smile:

Well, cloning an instance doesn’t reposition it. Just change the position of the hair to be on the dummy already while it’s in replicated storage, instead of having to do it in a script as a fix.

Sorry could you reprashe?
Like i have to set the position of the hair already in the replicated storage?

Correct. Just copy the hair into the viewport frame, and position it where the dummy is, then move it back to the replicated storage so you have a properly positioned hair.

Uh, i did it let’s say that it worked? but :skull_and_crossbones:
image

When applying accessories such as hair or hats, you can easily do so to rigs in workspace by having a server script clone the hat into the character.

It should work the same here, however, since this is a ViewportFrame, it lacks the physics properties of workspace.

I recommend adding a WorldModel inside of the ViewportFrame, then trying this technique.

1 Like

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