Applying Humanoid Descriptions to custom rigs?

Hello,

I am currently making my rig work with Roblox users’ custom avatars, however I reached a point where I don’t know which path I should take in achieving that (I need the most efficient and future-proof way of achieving this).

For additional context, the rig is a R15 one, however the character meshes of that rig strictly cannot change, so basically I just want to load the avatar assets onto the character without character mesh changes.

With that in mind, I cannot use Humanoid:ApplyDescription(), because if the user has an equipped limb different from the default 1.0 limb, my custom rig’s character mesh will change.


I have thought of two different ways of doing this:

1st: Use Players:CreateHumanoidModelFromDescription() and rip avatar assets from the model. I am not so sure if this might be the most efficient way.

2nd: Directly read through the HumanoidDescription and insert the assets myself using InsertService. I am not so sure if this might be the most future-proof way of doing this and also I am not so sure about certain InsertService limits.


So, what could be the most efficient and future-proof way of achieving this? Is there possibly a whole different way of doing this that I might not know of?

2 Likes

Would like to know as well! Anyone???

do you think something like this would work?

local players = game:GetService("Players")

local function getDescription(userid : number) : HumanoidDescription?
	local success, userdescription = pcall(players.GetHumanoidDescriptionFromUserId, players, userid)
	if (not success) then return end
	
	local newDescription = Instance.new("HumanoidDescription")	
	local save = {
		-- "AccessoryBlob", accessory blob is not scriptable
		"BackAccessory",
		"FaceAccessory",
		"FrontAccessory",
		"HairAccessory",
		"HatAccessory",
		"NeckAccessory",
		"ShouldersAccessory",
		"WaistAccessory",
		
		"HeadColor",
		"LeftArmColor",
		"RightArmColor",
		"LeftLegColor",
		"RightLegColor",
		"TorsoColor",
		
		"Face",
		
		"GraphicTShirt",
		"Pants",
		"Shirt",
	}
	
	for _, Property in next, save do
		newDescription[Property] = userdescription[Property]
	end
	
	return newDescription
end

I’ve been using the first method for almost a year now and I can tell you that I haven’t experienced any issues yet.

It isn’t bad in terms of performance as I originally thought, of course that depends on how you implement it. I highly suggest that you, in case you end up going with the 1st method, implement some sort of an asset cache that will store the ripped avatar assets.

As for InsertService, imo, because of its limits, it is not that reliable, so I suggest going with the first method.