So for the most part if for example i wanted to change the skin color i would just manually change the color of the player’s parts, like LeftFoot.Color3 = Color3.new. Then I thought that since theres a HumanoidDescription inside the humanoid why dont i use that instead. So now im using that, but then i just saw there is a Body Colors item in the player… a whole thing for Body Colors so now im wondering why is there 2 ways to change the skin color and which do i use
2nd problem is that the accessories wont apply when i do :ApplyDescription. I put the ID of a hat and when i do :ApplyDescription nothing happens.
Point is i dont really know what would be the best way to change the characters accessories. do i just manually add the accessory and parent it to the player or do it the way i was doing… with a fix because that isnt working right now, and how do i change the body colors? the description… the Body Colors item… or do i just change the brick color of the body parts itself
BodyColors are just an easy way to set the part colors of character limbs, especially with R15. Instead of having to go through and find every part of a limb, body colors will change the correct parts for you.
HumanoidDescriptions are basically templates that you can load onto a character. Changing the body colors in a humanoid description wont change anything until you apply that description to a humanoid.
If you want to add hats to a character, you will need to change the corresponding accessory property in the HumanoidDescription before you apply it.
I put a hat ID of a beanie into the HatAccesssory property.
And then I changed the head color property to green.
Then when I apply the description to my character, this is what I look like.
function character.changeHat(number)
--[[
if number == 1 then
for _, child in pairs(dummy:GetChildren()) do
if child.Name:sub(1, 4) == "hat_" then
print(child)
child:Destroy()
end
end
else
for _, child in pairs(dummy:GetChildren()) do
if child.Name:sub(1, 4) == "hat_" then
print(child)
child:Destroy()
end
end
print(hats[number])
for _, Child in pairs(asset:GetChildren()) do
Child.Parent = dummy --Move the children up one parent
Child.Name = `hat_{Child.Name}`
end
end
]]
if number == 1 then
dummy.Humanoid.HumanoidDescription.HatAccessory = ""
else
--local asset = insertservice:LoadAsset(hats[number])
dummy.Humanoid.HumanoidDescription.HatAccessory = hats[number]
end
dummy.Humanoid:ApplyDescription(dummy.Humanoid.HumanoidDescription)
whats commented out is the old way i was doing it before i realized i could do this, old way did work
So if you are setting up a base character, like a template, applying a description is fine. But I wouldnt use it every time you want to add an accessory. I would use :AddAccessory() like @awry_y suggested instead.
yeah i thought that way would be better, however, when i load in using insert service it puts the thing in a model, so i tried to do
if number == 1 then
dummy.Humanoid.HumanoidDescription.HatAccessory = ""
else
local asset = insertservice:LoadAsset(hats[number])
for _, Child in pairs(asset:GetChildren()) do
Child = asset
end
dummy.Humanoid:AddAccessory(asset)
end
dummy.Humanoid:ApplyDescription(dummy.Humanoid.HumanoidDescription)
errors out and says
AddAccessory should be passed a valid Accessory object.
Its also possible LoadAsset can fail if the service is unavailable, so you should make sure to wrap it in a pcall. It shows you what to do in the documentation: InsertService | Documentation - Roblox Creator Hub
why wouldnt you recommend using it everytime though. i was thinking about using HumanoidDescription because i thought changing the ID would replace the hat, if i do AddAccessory i would have to remove it manually since it adds the accessory.
Actually, I think its alright. I was under the impression that apply description entirely reloads the characters appearance, but thats only if you use ApplyDescriptionReset.
The only issue is that ApplyDescription may have unexpected behavior if you decide to change the character’s appearance through any other means. If you ARE doing this, you should use ApplyDescriptionReset instead.