Most games let players use their own Roblox avatar, although some implement an in-game customization system like the UGC Homestore template. Other games make limited modifications to player avatars such as helmets, wings, or accessories that match the genre.
To create a unique game that alters the appearance of your users, you can customize the default character properties through avatar settings or a manually modify appearance.
Global avatar settings
Studio's File ⟩ Avatar Settings allows you to quickly set several global player character properties in your game. These settings apply globally to all player character models joining your game. To modify specific characters, such as non-player character models, see manually modify appearance.
In this window, you can set various presets for clothing, accessories, body parts, collision behavior, animations and more. When editing these settings, a preview of the applied settings displays in the workspace.
For more information, see Avatar Settings.
Manually modify appearance
Character models contain a Humanoid object that gives the model special characteristics, such as walking, jumping, equipping items, and interacting with the environment.
You can programmatically modify a Humanoid by updating HumanoidDescription. This includes player character models or non-player character models in your game.
You can adjust the following character properties in your game using HumanoidDescription:
| Character property | Description |
|---|---|
| Scale | Number values for physical traits height, width, head, body type and proportion. This doesn't affect R6 body types. |
| Accessories | The asset IDs of accessories equipped by a character. |
| Classic Clothing | The asset IDs of the Shirt, Pants, and ShirtGraphic image textures that you can apply to the character. |
| Body Part | The asset IDs of the Face, Head, Torso, RightArm, LeftArm, RightLeg and LeftLeg parts of a character. |
| Body Colors | The BodyColors of the character's individual parts. |
| Animations | The asset IDs of Animations you can use on a character. |
Customize a character with HumanoidDescription using the following steps:
- Create a description from the user's character, a specific Outfit ID, or from a specific User ID.
- Modify the description to customize the properties that you want to apply to the Humanoid character.
- Apply the description on either a single character, all player characters, or even on all spawning characters.
Create HumanoidDescription
You can create a new HumanoidDescription instance directly within the Explorer hierarchy or within a Script with the following code:
Create new HumanoidDescription instancelocal humanoidDescription = Instance.new("HumanoidDescription")
In most cases, you should use an existing HumanoidDescription instead of a default new HumanoidDescription by referencing an existing player character, avatar outfit, or user ID.
From the player character
Use the following code sample to create a new HumanoidDescription based on the player character's current properties:
Generate a HumanoidDescription from a player characterlocal humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")local humanoidDescription = Instance.new("HumanoidDescription")if humanoid thenhumanoidDescription = humanoid:GetAppliedDescription()end
From an existing outfit
Use the following sample code to create a HumanoidDescription from an outfit ID using Players.GetHumanoidDescriptionFromOutfitID:
Generate a HumanoidDescription from an Outfit IDlocal Players = game:GetService("Players")local outfitId = 480059254local humanoidDescriptionFromOutfit = Players:GetHumanoidDescriptionFromOutfitId(outfitId)
From a specific user
Use the following sample code to create a HumanoidDescription from a user ID using Players:GetHumanoidDescriptionFromUserId():
Generate a HumanoidDescription from a user IDlocal Players = game:GetService("Players")local userId = 491243243local humanoidDescriptionFromUser = Players:GetHumanoidDescriptionFromUserId(userId)
Modify HumanoidDescription
To customize HumanoidDescription properties, set them directly on the HumanoidDescription or use a specified method before applying the HumanoidDescription to a character.
The following code sample provides examples of setting the different types of HumanoidDescription properties:
Update various HumanoidDescription propertieslocal humanoidDescription = Instance.new("HumanoidDescription")humanoidDescription.HatAccessory = "2551510151,2535600138"humanoidDescription.BodyTypeScale = 0.1humanoidDescription.ClimbAnimation = 619521311humanoidDescription.Face = 86487700humanoidDescription.GraphicTShirt = 1711661humanoidDescription.HeadColor = Color3.new(0, 1, 0)
Set multiple accessories
For layered or bulk accessory changes, you can use HumanoidDescription:SetAccessories() to make accessory related updates. The following code sample adds a layered sweater and jacket in that order to a HumanoidDescription:
Change multiple accessories at oncelocal humanoidDescription = Instance.new("HumanoidDescription")local accessoryTable = {{Order = 1,AssetId = 6984769289,AccessoryType = Enum.AccessoryType.Sweater},{Order = 2,AssetId = 6984767443,AccessoryType = Enum.AccessoryType.Jacket}}humanoidDescription:SetAccessories(accessoryTable, false)
Apply HumanoidDescription
Apply HumanoidDescription to specific Humanoid characters in your game with Humanoid:ApplyDescription() or Humanoid.LoadCharacterWithHumanoidDescription.
On a single character
ApplyDescription() can target any Humanoid. Use the following code to add a new pair of sunglasses and a new torso to the player character:
Update HumanoidDescription for a specific player characterlocal humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")if humanoid thenlocal descriptionClone = humanoid:GetAppliedDescription()descriptionClone.Torso = 86500008-- Multiple face accessory assets are allowed in a comma-separated stringdescriptionClone.FaceAccessory = descriptionClone.FaceAccessory .. ",2535420239"-- Apply modified "descriptionClone" to humanoidhumanoid:ApplyDescription(descriptionClone)end
On all player characters
Use the following sample code to apply a HumanoidDescription to all current players in the game:
Update HumanoidDescription for all current player characterslocal Players = game:GetService("Players")for _, player in Players:GetPlayers() dolocal humanoid = player.Character and player.Character:FindFirstChildWhichIsA("Humanoid")if humanoid then-- Create a HumanoidDescriptionlocal humanoidDescription = Instance.new("HumanoidDescription")humanoidDescription.HatAccessory = "2551510151,2535600138"humanoidDescription.BodyTypeScale = 0.1humanoidDescription.ClimbAnimation = 619521311humanoidDescription.Face = 86487700humanoidDescription.GraphicTShirt = 1711661humanoidDescription.HeadColor = Color3.new(0, 1, 0)humanoid:ApplyDescription(humanoidDescription)endend
On all spawning characters
Use the following sample code to set a specific HumanoidDescription for all spawning player characters:
Update HumanoidDescription for all spawning characters
local Players = game:GetService("Players")
-- Stop automatic spawning so it can be done in the "PlayerAdded" callback
Players.CharacterAutoLoads = false
local function onPlayerAdded(player)
-- Create a HumanoidDescription
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "2551510151,2535600138"
humanoidDescription.BodyTypeScale = 0.1
humanoidDescription.ClimbAnimation = 619521311
humanoidDescription.Face = 86487700
humanoidDescription.GraphicTShirt = 1711661
humanoidDescription.HeadColor = Color3.new(0, 1, 0)
-- Spawn character with the HumanoidDescription
player:LoadCharacterWithHumanoidDescription(humanoidDescription)
end
-- Connect "PlayerAdded" event to "onPlayerAdded()" function
Players.PlayerAdded:Connect(onPlayerAdded)
If the HumanoidDescription instance was created in the Explorer and parented to the workspace, use the following sample code in a Script to access the workspace instance:
local Players = game:GetService("Players")
-- Stop automatic spawning so it can be done in the "PlayerAdded" callback
Players.CharacterAutoLoads = false
local function onPlayerAdded(player)
-- Spawn character with "workspace.StudioHumanoidDescription"
player:LoadCharacterWithHumanoidDescription(workspace.StudioHumanoidDescription)
end
-- Connect "PlayerAdded" event to "onPlayerAdded()" function
Players.PlayerAdded:Connect(onPlayerAdded)
Layered clothing on non-R15
Caged accessories, like layered clothing, use WrapTarget and WrapLayer to stretch and wrap over a target Model. Layered accessories can work with both standard R15 Roblox characters and non-R15 models.
Custom implementation of layered clothing, such as a model using a unique cage UV map, cannot be uploaded and published to the Marketplace. For more information, see Layered clothing specifications.
Whether you are implementing layered accessories on an avatar R15 rig, or using a custom rig, ensure that your accessories and bodies include the following:
- The target model, typically the body, has a WrapTarget component on the meshes that additional models are intended to wrap around.
- The layering model, typically the clothing or accessory, has a WrapLayer component on the meshes meant to wrap the target model.
- The outer cage of the target model, and the inner and outer cage of the layering model have matching UV maps.
- The corresponding vertices on the target cage should have the same UVs as those vertices on the layer cage.
- If your target model is not R15, or doesn't include a Humanoid, you must add a Weld object to the layering MeshPart.
- The Weld must have Part0 and Part1 set to link the layering MeshPart to the Part hierarchy of the Model. For example, Part0 refers to the accessory and Part1 refers to the parent Part.
- If your target model is both R15 and includes a Humanoid, this weld is created automatically.