In my game I have a character customizer and I want it to detect if you have a hair on and put it onto the dummy
It works really well but I was testing hairs and I came across a problem
task.wait(0.1)
for i,v in pairs(Character:GetChildren()) do
if count <= 2 then
print(v)
if (v:IsA("Accessory") or v:IsA("Hat")) then
print(v)
hairName = v.Name
task.wait(0.1)
isHair = guessifhair(v.Name)
print(isHair)
if isHair == true then
CustomCharacter:WaitForChild("Humanoid"):AddAccessory(v:Clone())
print(v.Name..(" was added to CustomCharacter"))
count += 1
end
end
elseif count >= 4 then
print(v)
break
end
end
You’d have to take into account the R6 Head SpecialMesh scale (usually 1.25, 1.25, 1.25) and the scale of whatever size their R15 character’s head is.
I thought they’d normally be the same, but if a player has messed with their body’s scale it may affect it.
I wonder if you could read the Scale of the player’s head and script the Scale of your hair to change to adapt to it.