HumanoidDescription

Show Deprecated

HumanoidDescription is an object that stores a description a Humanoid for R6 and R15 rigs. It can be applied in order to set a rig's scaling, clothing (Shirt, Pants, ShirtGraphic), Accessories, Animations and BodyColors.

You can get a HumanoidDescription by using the following functions:

See also:

Summary

Properties

A JSON formatted array of Layered Accessories where each table in the entry in the array describes an accessory's AssetId, AccessoryType, Order, and (optionally) Puffiness as key-value pairs.

NOT SCRIPTABLE

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its back (such as capes).

Determines the factor by which the shape of a Humanoid rig is interpolated from the standard R15 body shape (0) to a taller and more slender body type (1); when applied, maps to the "BodyTypeScale" NumberValue within the HumanoidDescription.

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Climbing.

Determines by what factor the depth (back-to-front distance) of a Humanoid rig is scaled; when applied, maps to the "DepthScale" NumberValue within the Humanoid.

Determines the asset ID of the Face to be applied to the Humanoid.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to the front of its face (such as glasses).

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Freefall.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to front of its torso (such as medals or ties).

Determines the Graphic used by a ShirtGraphic when applied.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its head resembling hair.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its head.

Determines the asset ID of the Head to be applied to the Humanoid.

Determines by what factor the Head of a Humanoid is scaled; when applied, maps to the "HeadScale" NumberValue within the Humanoid.

Determines by what factor the height (top-to-bottom distance) of a Humanoid rig is scaled; when applied, maps to the "HeightScale" NumberValue within the Humanoid.

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Running at a speed near zero.

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Jumping.

Determines the asset ID of the LeftArm to be applied to the Humanoid.

Determines the asset ID of the LeftLeg to be applied to the Humanoid.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its neck (such as scarves or necklaces).

Determines the PantsTemplate used by a Pants when applied.

Determines how wide (0) or narrow (1) a Humanoid rig is; when applied, maps to the "BodyProportionScale" NumberValue within the Humanoid.

Determines the asset ID of the RightArm to be applied to the Humanoid.

Determines the BodyColors.RightArmColor3 and BodyColors.RightArmColor of a Humanoid when applied.

Determines the asset ID of the RightLeg to be applied to the Humanoid.

Determines the BodyColors.RightLegColor3 and BodyColors.RightLegColor of a Humanoid when applied.

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Running at a moderate speed.

Determines the ShirtTemplate used by a Shirt when applied.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its shoulders (such as shoulder-mounted critters).

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Swimming.

Determines the asset ID of the Torso to be applied to the Humanoid.

Determines the BodyColors.TorsoColor3 and BodyColors.TorsoColor of a Humanoid when applied.

A comma-separated list of asset IDs that will be added as Accessories to a Humanoid rig when applied, usually those attached to its waist (such as belts).

When this description is applied to a Humanoid, this determines the Animation.AnimationId to play when its state is Running at a low speed.

Determines by what factor the width (left-to-right distance) of a Humanoid is scaled; when applied, maps to the "BodyWidthScale" NumberValue within the Humanoid.

Events


Fires when emotes are added, removed or set on this description.


Fires when the equipped emotes are set on this description.

Methods

AddEmote(name: string, assetId: number): nil  

Adds the emote to the description given a name and its asset ID.

GetAccessories(includeRigidAccessories: boolean): Array  

Returns a table of an avatar's current accessories.


Returns a dictionary of emotes that have been added or set to this description.


Returns an array of tables describing the equipped emotes that have been set.

RemoveEmote(name: string): nil  

Removes any emotes that have been added under the given name.

SetAccessories(accessories: Array, includeRigidAccessories: boolean): nil  

Accepts a table that sets the accessories and related properties for an avatar.

SetEmotes(emotes: Dictionary): nil  

Sets all of the emotes on this description.

SetEquippedEmotes(equippedEmotes: Array): nil  

Sets the currently equipped emotes given an array of emote names.

Properties

AccessoryBlob

Not Scriptable

A JSON formatted array of Layered Accessories where each table in the entry in the array describes an acccessory's AssetId, AccessoryType, Order, and (optionally) Puffiness as key-value pairs. This can be edited in the properties windows for the HumanoidDescription.

To make changes from Lua (which is recommended over editing the JSON directly), use HumanoidDescription:SetAccessories() and HumanoidDescription:GetAccessories(). These methods can also be enabled to work with rigid accessories by setting IncludeRigidAccessories parameters to true.

BackAccessory

BackAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied. The list cannot contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

BodyTypeScale

BodyTypeScale determines by which the shape of a Humanoid rig is interpolated from the standard R15 body shape (0) to a taller and more slender/realistic body type (1). Values outside of the [0-1] range are clamped. When the description is applied to a Humanoid, this value maps to a "BodyTypeScales" NumberValue within the Humanoid.

When the value of this property is 0, the ProportionScale property does not have any effect.

In the image, three R15 figures whose Humanoids have HumanoidDescriptions applied with the following BodyTypeScales values (from left-to-right): 0, 0.5, 1.0. Also visible are 6 stacked 1x1x1 cube parts for reference.

See also:

ClimbAnimation

When this description is applied to a Humanoid, ClimbAnimation determines the Animation.AnimationId to play when its state is Climbing.

See also:

DepthScale

DepthScale determines by what factor the height (back-to-front distance) of a Humanoid is scaled, as well as all accessories not attached to its head. When the description is applied to a Humanoid, this value maps to a "BodyDepthScale" NumberValue within the Humanoid.

In the image, three R15 figures whose Humanoids have HumanoidDescriptions applied with the following DepthScale values (from left-to-right): 0.25, 1.0, 2.0.

See also:

Face

Face determines the asset ID of the Face to be applied to a Humanoid. The type of the asset ID provided must be for a Face type asset and not a Decal or Image type asset.

The actual face texture is rendered using a Decal in the Head named "face" or "Face".

See also:

FaceAccessory

FaceAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to the front of its face (such as glasses). The list does not contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

FallAnimation

When this description is applied to a Humanoid, FallAnimation determines the Animation.AnimationId to play when its state is Freefall.

See also:

FrontAccessory

FrontAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to front of its torso (such as medals or ties). The list does not contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

GraphicTShirt

GraphicTShirt determines the Graphic used by a ShirtGraphic when applied to a Humanoid. The asset type must be for a T-Shirt and not a Decal or Image.

See also:

HairAccessory

HairAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its head resembling hair. The list does not contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

HatAccessory

HatAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its head. The list does not contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

Head determines the asset ID of the Head to be applied to a Humanoid.

See also:

HeadColor

HeadColor determines the BodyColors.HeadColor3 and BodyColors.HeadColor of a Humanoid when the description is applied.

See also:

HeadScale

HeadScale determines by what factor the Head of a Humanoid is scaled, as well as any accessories attached to it (such as those specified by HatAccessory and HairAccessory). When the description is applied to a Humanoid, this value maps to a "HeadScale" NumberValue within the Humanoid.

In the image, three R15 figures whose Humanoids have HumanoidDescriptions applied with the following HeadScale values (from left-to-right): 0.5, 1.0, 1.5.

See also:

HeightScale

HeightScale determines by what factor the height (top-to-bottom distance) of a Humanoid is scaled, as well as all accessories not attached to its head. When the description is applied to a Humanoid, this value maps to a "BodyHeightScale" NumberValue within the Humanoid.

In the image, three R15 figures whose Humanoids have HumanoidDescriptions applied with the following HeightScale values (from left-to-right): 0.5, 1.0, 1.5.

See also:

IdleAnimation

When this description is applied to a Humanoid, IdleAnimation determines the Animation.AnimationId to play when its state is Running at a speed near zero.

See also:

JumpAnimation

When this description is applied to a Humanoid, JumpAnimation determines the Animation.AnimationId to play when its state is Jumping.

See also:

LeftArm

LeftArm determines the asset ID of the LeftArm to be applied to a Humanoid.

See also:

LeftArmColor

LeftArmColor determines the BodyColors.LeftArmColor3 and BodyColors.LeftArmColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and hand parts of the left arm.

See also:

LeftLeg

LeftLeg determines the asset ID of the LeftLeg to be applied to a Humanoid.

See also:

LeftLegColor

LeftLegColor determines the BodyColors.LeftLegColor3 and BodyColors.LeftLegColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and foot parts of the left leg.

See also:

MoodAnimation

NeckAccessory

NeckAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its neck (such as scarves or necklaces). The list does not contain duplicates.

Any accessory can used in this property, even if it is meant to go in a different accessory spot. For example, an accessory meant to go on your back (such as a cape) could be included in HairAccessory. An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

Pants

Pants determines the PantsTemplate used by a Pants when applied to a Humanoid. The asset type must be for a Pants and not a Decal or Image.

See also:

ProportionScale

ProportionScale determines how wide (0) or narrow (1) a Humanoid rig. Values outside of the [0-1] range are clamped. When the description is applied to a Humanoid, this value maps to a "BodyProportionScale" NumberValue within the Humanoid.

When the value of BodyTypeScale is 0, this property does not have any effect.

In the image, four R15 figures are visible whose Humanoids have HumanoidDescriptions applied with the following ProportionScale values (from left-to-right): 0, 0.5, 1.0, 0.0. Each have a BodyTypeScale of 1.0, except for the right which has 0.0. Also visible are 6 stacked 1x1x1 cube parts for reference. The table below lists the BodyTypeScale and ProportionScale values for each figure in the image.

Value1st2nd3rdControl
BodyTypeScale1.01.01.00.0
ProportionScale0.00.51.00.0

See also:

RightArm

RightArm determines the asset ID of the RightArm to be applied to a Humanoid.

See also:

RightArmColor

RightArmColor determines the BodyColors.RightArmColor3 and BodyColors.RightArmColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and hand parts of the right arm.

See also:

RightLeg

RightLeg determines the asset ID of the RightLeg to be applied to a Humanoid.

See also:

RightLegColor

RightLegColor determines the BodyColors.RightLegColor3 and BodyColors.RightLegColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper, lower, and foot parts of the right leg.

See also:

RunAnimation

When this description is applied to a Humanoid, RunAnimation determines the Animation.AnimationId to play when its state is Running at a moderate speed.

See also:

Shirt

Shirt determines the ShirtTemplate used by a Shirt when applied to a Humanoid. The asset type must be for a Shirt and not a Decal or Image.

See also:

ShouldersAccessory

ShouldersAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its shoulders (such as shoulder-mounted critters). The list does not contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

SwimAnimation

When this description is applied to a Humanoid, SwimAnimation determines the Animation.AnimationId to play when its state is Swimming

See also:

Torso

Torso determines the asset ID of the Torso to be applied to a Humanoid.

See also:

TorsoColor

TorsoColor determines the BodyColors.TorsoColor3 and BodyColors.TorsoColor of a Humanoid when the description is applied. For R15 and Rthro rigs, this property controls both the upper and lower parts of the torso.

See also:

WaistAccessory

WaistAccessory is a comma-separated list of asset IDs that determine what accessories should be added when the description is applied, usually those attached to its waist (such as belts). The list does not contain duplicates.

An error is thrown if you try to apply a new description which shares any assets with the existing description but a different accessory property.

See also:

WalkAnimation

When this description is applied to a Humanoid, WalkAnimation determines the Animation.AnimationId to play when its state is Running at a low speed

See also:

WidthScale

WidthScale determines by what factor the width (left-to-right distance) of a Humanoid is scaled, as well as all accessories not attached to its head. When the description is applied to a Humanoid, this value maps to a "BodyWidthScale" NumberValue within the Humanoid.

In the image above, three R15 figures whose Humanoids have HumanoidDescriptions applied with the following WidthScale values (from left-to-right): 0.5, 1.0, 1.5.

See also:

Events

EmotesChanged

EmotesChanged fires when emotes are added, removed or set on the description. The event fires with the new emote table as returned by GetEmotes.

If AddEmote is called with the same name and ID as an existing emote, this event fires.

See also:

Parameters

newEmotes: Dictionary

A dictionary of emotes where the key is the emote name and the value is an array of emote asset IDs. Example:


1{
2 Salute = {3360689775},
3 Agree = {4849487550},
4 Disagree = {4849495710}
5}
6```.
7

EquippedEmotesChanged

EquippedEmotesChanged fires when the equipped emotes are set on this description using SetEquippedEmotes. It provides the new equipped emotes in a table like that returned by GetEquippedEmotes.

Example


1local hd = Instance.new("HumanoidDescription")
2hd.EquippedEmotesChanged:Connect(function (equippedEmotes)
3 print(("We have %d emotes equipped"):format(#equippedEmotes))
4 for _, t in pairs(equippedEmotes) do
5 print(("In slot %d: emote %s is equipped"):format(t.Slot, t.Name))
6 end
7end)
8hd:SetEquippedEmotes({"Salute", "Agree"}) --> We have 2 emotes equipped
9

See also:

Parameters

newEquippedEmotes: Array

An array of tables describing the name and slot which each emote is equipped. Example:


1{
2 {Slot = 3, Name = "Salute"},
3 {Slot = 2, Name = "Agree"},
4 {Slot = 1, Name = "Disagree"},
5}
6```.
7

Methods

AddEmote

AddEmote will add an Emote asset to the description given a name and its asset ID. The asset ID must be for an "Emote" asset (see Featured emotes in the Catalog).

You can add multiple emotes of the same name. All emotes of the same name can be removed using RemoveEmote. If an emote with the same ID is added under the same name, EmotesChanged fires.

See also:

Parameters

name: string

A string that identifies what emote is being added. Example: "Salute".

assetId: number

An emote asset ID.


Returns

GetAccessories

Returns a table of an avatar's current accessories. If the second parameter (includeRigidAccessories) is true then the returned table will also include entries for rigid accessories from the rigid accessory properties.

Parameters

includeRigidAccessories: boolean

Set to true if rigid accessories from the rigid accessory properties should also be included in the return array. False means only include layered clothing accessories from the AccessoryBlob.


Returns

Returns an array where each entry specifies for an individual accessory the AccessoryType, AssetId, IsLayered, Order and Puffiness.

Code Samples

Get Accessories

1local includeRigidAccessories = true
2local accessoriesTable = game:GetService("Players"):GetHumanoidDescriptionFromUserId(1):GetAccessories(includeRigidAccessories)
3for _, accessoryInfo in ipairs(accessoriesTable) do
4 print(tostring(accessoryInfo.AssetId) .. " " .. tostring(accessoryInfo.AccessoryType))
5end

GetEmotes

GetEmotes returns a dictionary of emotes that have been added or set to this description. The keys of this dictionary are the names of the emotes, and the values are a non-empty array of emote IDs for that name.

Example


1local hd = Instance.new("HumanoidDescription")
2hd:AddEmote("Salute", 3360689775)
3local emotes = hd:GetEmotes()
4for name, ids in pairs(emotes) do
5 print(("The emote %s has %d ids:"):format(name, #ids))
6 for _, id in pairs(ids) do
7 print(id)
8 end
9end
10

See also:


Returns

A dictionary of emotes where the key is the emote name and the value is an array of emote asset IDs. Example:


1{
2 Salute = {3360689775},
3 Agree = {4849487550},
4 Disagree = {4849495710}
5}
6```.
7

GetEquippedEmotes

GetEquippedEmotes returns an array of tables which indicate the Name and Slot of each equipped emote as it was set by SetEquippedEmotes.

Example


1local hd = Instance.new("HumanoidDescription")
2hd:SetEmotes{Salute = {3360689775}, Agree = {4849487550}}
3hd:SetEquippedEmotes({"Salute", "Agree"})
4-- Iterate over the equipped emotes:
5for _, t in pairs(hd:GetEquippedEmotes()) do
6 print(("In slot %d: emote %s is equipped"):format(t.Slot, t.Name))
7end
8

See also:


Returns

An array of tables describing the name and slot which each emote is equipped. Example:


1{
2 {Slot = 3, Name = "Salute"},
3 {Slot = 2, Name = "Agree"},
4 {Slot = 1, Name = "Disagree"},
5}
6```.
7

RemoveEmote

RemoveEmote removes all emotes from the description that have been added or set under the given name. If there are no added emotes with the given name, no error is thrown and EmotesChanged does not fire.

See also:

Parameters

name: string

The name of the emote as it was set or added.


Returns

SetAccessories

Accepts a table that sets the accessories and related properties for an avatar. If the second parameter (includeRigidAccessories) is true, then this function can also be used to set the rigid accessories in the rigid accessory properties. In this case any table entry that does not have an Order will be considered a rigid accessory and put in the appropriate property according to the AccessoryType.

Parameters

accessories: Array

Each entry specifies for an individual accessory the AccessoryType, AssetId, IsLayered, Order and Puffiness.

includeRigidAccessories: boolean

Set to true if rigid accessories are also included in the passed in array (they would have to not specify Order).


Returns

Code Samples

Set Accessories

1local humanoidDescription = Instance.new("HumanoidDescription")
2local originalSpecifications = {
3 {
4 Order = 1,
5 AssetId = 123456789,
6 Puffiness = 0.5,
7 AccessoryType = Enum.AccessoryType.Sweater
8 }
9}
10humanoidDescription:SetAccessories(originalSpecifications)
11
12local updatedSpecifications = humanoidDescription:GetAccessories(false)
13local newIndividualSpecification = {
14 Order = 2,
15 AssetId = 987654321,
16 Puffiness= 0.7,
17 AccessoryType = Enum.AccessoryType.Jacket,
18 IsLayered = true
19}
20updatedSpecifications[#updatedSpecifications + 1] = newIndividualSpecification
21humanoidDescription:SetAccessories(updatedSpecifications)

SetEmotes

SetEmotes sets all of the emotes on this description given a table similar to that returned by GetEmotes. It fires EmotesChanged

Example


1local emotes = {
2 Salute = {3360689775}, -- Syntax note: can also use ["Salute"] = ...
3 Agree = {4849487550},
4 Disagree = {4849495710}
5}
6local hd = Instance.new("HumanoidDescription")
7hd:SetEmotes(emotes)
8

See also:

Parameters

emotes: Dictionary

A dictionary of emotes where the key is the emote name and the value is an array of emote asset IDs. Example:


1{
2 Salute = {3360689775},
3 Agree = {4849487550},
4 Disagree = {4849495710}
5}
6```.
7

Returns

SetEquippedEmotes

SetEquippedEmotes sets the currently equipped emotes given an array of emote names as they were passed to AddEmote or SetEmotes. It can also take an array of tables similar to that returned by GetEquippedEmotes. Calling this function fires EquippedEmotesChanged.

Example


1local hd = Instance.new("HumanoidDescription")
2hd:SetEmotes{Salute = {3360689775}, Agree = {4849487550}}
3-- Can provide either an array of strings... (index is slot number)
4hd:SetEquippedEmotes({"Salute", "Agree"})
5-- ...or an array of tables as returned by GetEquippedEmotes (Slot and Name keys set)
6hd:SetEquippedEmotes({{Slot = 1, Name = "Salute"}, {Slot = 2, Name = "Agree"}})
7

See also:

Parameters

equippedEmotes: Array

An array of emote names. Example:


1{ "Disagree", "Agree", "Salute" }
2

– OR – An array of tables describing the name and slot which each emote is equipped. Example:


1{
2 {Slot = 3, Name = "Salute"},
3 {Slot = 2, Name = "Agree"},
4 {Slot = 1, Name = "Disagree"},
5}
6```.
7

Returns