New API For Equipping Assets on Humanoid Player Avatars

avatar
humanoid
player

#32

It’s a very nice addition, but I wish there was a method to disable loading few properties.

Like, I want to use custom animations - right?
I don’t wan’t to do a workaround to fix outfits :slight_smile:


#33

The update is pretty awesome! It’s going to be more useful now! Thank you so much!


#34

The names of these APIs are a bit verbose, but given that they’re named exactly what they do there’s not much to be done about that I suppose.

I’m always in favor of making messing with humanoids easier, so this is a welcome addition.


#35

Woah! This is very cool! Great work. This is actually really useful and saves me a lot of time.

Goodbye game:service'InsertService':LoadAsset(id):GetChildren()[1].Parent = workspace.RoyallyFlushed for every time I want to test a bloody hat.

Keep up the good work!


#36

Manipulating outfits has always been a major nuisance. Thanks.


#37

This is the BEST update for me, in a long time! I have struggled with these issues ever since R15 was introduced. :smiley:


#41

This should be completely possible with this new API.
When a player loads in you simply create a copy of their HumanoidDescription with modified values.

local humDesc = game:GetService("Players"):GetHumanoidDescriptionFromUserId(player.UserId)
humDesc.BodyTypeScale=0.3
humDesc.DepthScale=1
humDesc.HeadScale=1
humDesc.HeightScale=1
humDesc.ProportionScale=1
humDesc.WidthScale=1
player:LoadCharacterWithHumanoidDescription(humDesc)

There is a quick and dirty example that loads a players character but removes their scaling. You could use the same concept to remove types of accessories, or even whitelist shirts past an otherwise default.


#42

Mhm. That sounds reasonable, but I mean custom animation scripts will mess whole script up.


#43

That they would, however if the idea is that you are just replacing default animations you can easily do that by setting them in the same way.

humDesc.WalkAnimation = myCustomWalkAnimID

That would override players Walk Animation with your own custom one. If you are using custom animations for walking as a whole it’s going to be the same as using custom characters: not meant to be covered by the scope of this new API.


#44

This will definitely make loading in customized appearances in-game a lot easier, a nice helpful API, time to start testing its limits for requests on ‘GetHumanoidDescriptionFromUserId’


#45

thanks for the suggestion, we will change the icon soon


#46

I am going to use this feature a lot when I am going to begin developing a game…
Thanks! :wink:


#47

Maybe it would be better to rename ShouldersAccessory to just ShoulderAccessory. I bring it up because AssetTypes uses Shoulder and to me it just seems like an odd exception.


#48

This is really cool! I think this is awesome, but the fact that I can’t customize characters with custom accessories without uploading them as separate models is disappointing.

Is there a chance we could get properties like BackAccessoryTemplate, HeadTemplate, ClimbAnimationTemplate, etc. which are Object references to Instances already in the game that will be cloned? This would make it a lot easier to use custom appearance items and be a much better solution if you have hundreds of them. I don’t foresee developers with hundreds of custom items uploading them all – they will probably just stick with the hacky methods they use now.


#49

I just think its ironic, how I just finished my own custom code to do this, starting in October, and just finished earlier this month. Well played Roblox… well played!


#50

Hey! Absolutely love this addition, I was writing my own code for managing appearances but it wasn’t very future-proof. This will help a lot to set the standard, just a couple problems I’ve found:

  • Swapping my character to one with a package, then back to my character, causes some accessories to fall off. BuildRigFromAttachments right after ApplyDescription isn’t working to remedy this.
  • Sometimes the character’s joints are broken between swaps.

I can repro accessories falling off 100% of the time with this script in ServerScriptService (let it cycle back to the first user ID). The character dying isn’t happening consistently, but I believe it to be an issue with body part swapping.

local players = game:GetService("Players")

local userIds = {
	1343930, -- my character
	292087656, -- avatar with package
	28184036, -- avatar with package
}

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		repeat wait() until character:IsDescendantOf(workspace)
		local humanoid = character:WaitForChild("Humanoid")
		
		while true do
			for _, userId in ipairs(userIds) do
				local description = players:GetHumanoidDescriptionFromUserId(userId)
				humanoid:ApplyDescription(description)
				-- humanoid:BuildRigFromAttachments()
				wait(1)
			end
		end
	end)
end)

#51

We will take a look into this. Thanks for letting us know.


#52

Also if possible, the option to be able to do this client-side would be very handy. Currently ApplyDescription only works from the server. For my purposes I’d like snappy, instantaneous character transformations, and having to worry about the latency is kind of a bummer in regards to that


#53

Thanks for the feedback. This is something we are considering for the future, but we haven’t put a timeline on it as yet.


#54

I found a little bug with loading moderated TShirts, here’s TShirt1 and TShirt2. Doing the following in the command bar:

local humDesc = Instance.new("HumanoidDescription")
humDesc.GraphicTShirt = 734243445
game.Players.Vulkarin.Character.Humanoid:ApplyDescription(humDesc)

Gets me no errors and as expected doesn’t show the TShirt. When I change it to:

humDesc.GraphicTShirt = 150741354

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