New API For Equipping Assets on Humanoid Player Avatars

Does LoadCharacterWithHumanoidDescription work? I’d guess it replaces all body parts of your avatar which would kill you.

6 Likes

It should not kill you, but there is an issue now where it will do sometimes - we’re looking into this issue now

11 Likes

I tried a few of their examples, and some of them don’t work as mentioned, here’s how I do mine:

players.PlayerAdded:Connect(function(ply)
ply.CharacterAdded:Connect(function(character)
	local humanoid = character and character:FindFirstChildOfClass("Humanoid")
	if humanoid then
		humanoid.Died:Connect(function()
			wait(1)
			local humanoidDescriptionForUser = game.Players:GetHumanoidDescriptionFromUserId(ply and ply.UserId)
	
			humanoidDescriptionForUser.Head = -1
			
			ply:LoadCharacterWithHumanoidDescription(humanoidDescriptionForUser)
		end)
	end
end)
local humanoidDescriptionForUser = game.Players:GetHumanoidDescriptionFromUserId(ply and ply.UserId)

humanoidDescriptionForUser.Head = -1

ply:LoadCharacterWithHumanoidDescription(humanoidDescriptionForUser)

end)

6 Likes

Do you do anything special when spawning your avatar? If not, could you give me your userId and I can check if maybe the issue is specific to your current avatar set-up?

6 Likes

Nothing special. My user ID is 1907709, but it happened to my friend too. It probably only happens if the Head or UpperTorso get swapped with a new block.

If I change from using ID 1 to using my own, I won’t die. I’ll check if changing the ID to someone else’s who also has no packages on won’t kill me.

5 Likes

thanks!

6 Likes

With the code provided above, if I grab a description for the user ID’s 1 or 3 I can die, but not if I use user ID 2. The account with user ID 2 has the same UpperTorso as me, whereas the other two don’t.

6 Likes

thanks, that’s great info

6 Likes

Any plans to allow this API to work with NPCs? I have a character customization script in my game that I use to edit assets on both players and NPCs, and I’d love to use this API but it doesn’t make sense to write a separate system that uses this if I still have to keep my older system so I can customize NPCs.

(The current error I get when working with NPCs is “Humanoid::ApplyDescription() cannot be used when the StarterPlayer or Animate script has been overriden”)

7 Likes

Great for creating 3d leaderboards. Nice for easily cloning characters too.

5 Likes

we’re considering what features to add to it. We may make it more generic to work with NPC’s and custom starter player characters, but no firm plans as yet

6 Likes


Wow this is cool, check out this funny use case i found for it.

18 Likes

cool

9 Likes

Well, now I have to fix all my coding to fit this new system since I used to just weld the hats to the player cause that was the only way to do it. At least this new feature will be a lifesaver in the future! :sweat_smile:

6 Likes

This will be really helpful in changing characters appearances. Thank you for this great update!

6 Likes

As already stated above, when you use the ApplyDescription function and originally have a different UpperTorso from the new HumanoidDescription there is a chance of your character dying, only occurring sometimes. I’ve also ran into the problem of BodyScale not being applied correctly, as seen in the picture (also inconsistent). In addition to these problems, I’ve also found that you are able to apply shirts & t-shirts using the pants property (sometimes resulting in a naked character) and vice-versa. I’ve only experimented with the accessories, clothing, scale, and body color properties so I’m assuming there’s more bugs given how new the feature is. All of these bugs occurred when cloning my existing description (using GetAppliedDescription), changing a property, and applying the cloned description with the new properties. Great feature, just extremely buggy at the moment.

8 Likes

Thanks for the feedback. All these issues are being looked into. The character dying one will be fixed in the next studio/client release

9 Likes

How come we’re limited to assets from the catalog?

A lot of developers often combine assets from both the catalog and library when morphing avatars and NPCs (such as custom faces).

I’d love to get on board with this new API, however it seems impractical to do so if it requires having two systems just to use assets from the library.

5 Likes

If you’re talking about accessories (like hats, wings, etc) I’m pretty sure other users have already stated you can use custom models you have uploaded. You can keep them private and call them by ID from your games.

6 Likes

I was thinking more along the lines of faces, for example the following code produces the following error:

local desc = humanoid:GetAppliedDescription()
desc.Face = 181776977
humanoid:ApplyDescription(desc)

Humanoid::ApplyDescription() Assets are incorrect for the Humanoid Description slots they have been assigned to

Thanks for the highlighting the trick with assets, I didn’t realise that before! After playing around with HumanoidDescriptions a bit more I’m finding they’re actually really useful.

6 Likes