HumanoidDescription not loading the hair on a Dummy

Hey! I was wondering what was happening in my Shop system. Mainly because whenever I load in a screen to preview it puts everything on correctly, but it doesn’t give the person hair? I think it has something to do with the dummy being in a viewport frame, because it works totally fine when I load it on the player.

Here is my code for loading the skin on:

    local object = viewportFrame.Dummy
	object.HumanoidRootPart.Position = Vector3.new(0, 0, 0)
	object.Parent = viewportFrame

	local viewportCamera = viewportFrame:FindFirstChildOfClass("Camera") or Instance.new("Camera")
	viewportFrame.CurrentCamera = viewportCamera
	viewportCamera.Parent = viewportFrame
	viewportCamera.CFrame = CFrame.new(Vector3.new(0, 2, 6), object.HumanoidRootPart.Position)
	
	if currentType.Value == "Emotes" then
		local anim = object.Humanoid:LoadAnimation(script.Parent.Animation) --object.Humanoid.Animation)
		anim.Priority = Enum.AnimationPriority.Action
		anim.Looped = true
		anim:Play()
		print("Heheh")
	elseif currentType.Value == "Skins" then
		game:GetService("ReplicatedStorage").Events.ChangeShopSkin:FireServer(object, itemsDict[currentType.Value][currentItem.Value].Name)
	end
events.ChangeShopSkin.OnServerEvent:Connect(function(player, dummy, skinName)
	dummy.Humanoid:ApplyDescription(skins[skinName])
end)


Any ideas?

2 Likes

does the hair exist (in vpf) when you check your explorer?

I checked and it is in explorer so it loads it, but I suppose doesn’t position it?

Screen Shot 2022-09-07 at 6.16.34 PM

Also here is the properties menu for the hat if you need it :wink:

Screen Shot 2022-09-07 at 6.16.57 PM

I would suggest manually applying the hair

perhaps after applying the humanoid description, try locating the hair and use

Humanoid:AddAccessory(HairObject)

or

Humanoid:AddAccessory(viewportFrame.Dummy:FindFirstChildOfClass("Accessory"))

also i can’t see the images, its broken on my end for some reason

idk why its not properly adding the accessory to begin with though.

I found out that the hair only doesn’t appear when it is in a viewport frame? I have no idea why.

did my code snippet not help?

alternatively you could clone the hair object into the dummy manually rather than letting the humanoid description handle it and see how that goes

I used your code in mine and nothing happened, I also tried cloning the hair manually, I honestly don’t know what to do at this point. Is it just a studio bug?

Is the dummy inside viewportframe i.e. in game.playergui or do you clone it from workspace (or etc) into the player’s gui on runtime?

It remains in the viewport frame the whole time. Should I try cloning from workspace?

no, its proper that you have it in the playergui by default, as thats what i have on my own customization system too (i had bugs cloning it from workspace–related to accessories)

Is the hair a custom made accessory or is it from roblox catalog?

you also don’t have to do this but it could help by sending a demo file so i could test it, i can only eyeball it at this point since everything is in accordance to how it should be

It’s straight from the catalog, it loads in from a humanoid description in server storage (with remote event) using the catalog ID.

another suggestion would be instead of passing the dummy as an object, let the server just access the dummy via player

snippet from my own code

EquipOnDummy.OnServerEvent:Connect(function(player)
Designation = player.PlayerGui.Shop.ViewportFrame.ViewportFrame.WorldModel.Dummy

--add accessory manually or do humanoid desc
local AccessoryClone=Hair:Clone()
Designation.Humanoid:AddAccessory(AccessoryClone)
--...

also ignore viewportframe.viewportframe, its just the way i have the thing made, i have a frame called vpf and a vpf called vpf

@bostnm

1 Like

Alright, I’ll try this tomorrow when I can!

Wish me luck :wink:

Can you mark this as the solution if it worked?

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