Accessory Adjustment APIs for experiences

Hi Creators,

As some of you may have seen, we rolled out the Accessory Adjustment tool to the Avatar Editor recently. We’ve seen really positive community feedback from the platform launch, and now we want to give you the ability to add this functionality to your experiences with the Accessory Adjustment API.


Accessory Adjustment in the platform Avatar Editor

You can implement Accessory Adjustment in your experiences using the new upgraded HumanoidDescription API. You can enable your users to alter position, rotation, and scale of Head and Face accessories on their avatars – both accessories they own and items they’re trying on before deciding to purchase.This opens up a new world of compatibility between different avatars and accompanying Head and Face accessories.

When the user owns the adjusted accessories, these adjustments can be saved back to the platform using AvatarEditorService:PromptSaveAvatar. Additionally, you can pair this with `PromptCreateOutfit’ to let the user save their full Avatar with adjustments back to the platform under Characters > Saved.

Here’s an example server script and local script you can try out yourself:

Server Script:

-- Accessory Adjustment server script

local Players = game:GetService("Players")
local userId = -1 -- replace with your userId
local playerModel = Players:CreateHumanoidModelFromUserId(userId)
playerModel.Parent = workspace
local humanoid = playerModel.Humanoid
local newHD = game.Players:GetHumanoidDescriptionFromUserId(userId)
local accessoryDescription = Instance.new("AccessoryDescription")
accessoryDescription.AssetId = 4819740796 -- add a hat that you own
accessoryDescription.AccessoryType = Enum.AccessoryType.Hat
accessoryDescription.Parent = newHD
playerModel.Humanoid:ApplyDescription(newHD)

for i, description in humanoid.HumanoidDescription:GetChildren() do
	if description:IsA("AccessoryDescription") then
		-- AccessoryDescriptions also help you get the Instance of the accessory, which will be helpful in adjustment
		-- For example, we can show the user which accessory is selected by adorning a SelectionBox
		local selectionBox = Instance.new("SelectionBox")
		local accessoryInstance = description:GetAppliedInstance()
		-- Adorn to the MeshPart Handle under the Accessory Instance
		selectionBox.Adornee = accessoryInstance.Handle
		selectionBox.Parent = workspace

		-- setting the adjustments
		description.Position = Vector3.new(0.2, 0.2, 0.2)
		description.Rotation = Vector3.new(20, 20, 20)
		description.Scale = Vector3.new(1.1, 1.1, 1.1)
	end
end

local appliedDescription = humanoid.HumanoidDescription:Clone()
appliedDescription.Name = "AppliedDescription"
appliedDescription.Parent = workspace

Local Script:

-- Accessory Adjustment local script
local AvatarEditorService = game:GetService("AvatarEditorService")

-- get the appliedDescription made from our server script
local appliedDescription = workspace:WaitForChild("AppliedDescription")
-- save the avatar with the adjustments
AvatarEditorService:PromptSaveAvatar(appliedDescription, Enum.HumanoidRigType.R15)
--same with PromptCreateOutfit to create outfits
--AvatarEditorService:PromptCreateOutfit(appliedDescription, Enum.HumanoidRigType.R15)

Please Note: To keep the platform safe, we are only allowing Face and Head accessory adjustments at this time. In the future, we will be expanding the types of accessories, specifically Neck/Shoulder and then Front/Back. Some accessory categories will have a limited ability to be adjusted to ensure avatars are appropriate for the Roblox.

To access the currently allowed AssetTypes and adjustment limits of each accessory type, the Avatar Rules have been updated:

local AvatarEditorService = game:GetService("AvatarEditorService")
local avatarRules = AvatarEditorService:GetAvatarRules()

–- AccessoryRefinementTypes is a list of the allowed AssetType values
print(avatarRules.AccessoryRefinementTypes)
–- AccessoryRefinementUpperBounds is a table of the allowed upper adjustment limits for each accessory type
print(avatarRules.AccessoryRefinementUpperBounds)
–- AccessoryRefinementUpperBounds is a table of the allowed lower adjustment limits for each accessory type
print(avatarRules.AccessoryRefinementLowerBounds)

AccessoryRefinementUpperBounds and AccessoryRefinementLowerBounds allow you to check that your experience doesn’t apply an adjustment that can’t be saved to the platform. Trying to save values out of the bounds will clamp the values during saving.

Special thanks to the team that helped make this happen: @JollySunbro6, @Peaze4ly, @gcheck14552, @Nimniteshyamalan, @LoboTheCzarnian, @legendRf20, @SergeantBlocky, @misterpebblez, @Padi_Xiaokeai, @pbloxi, @Vvhere2021, @FarazTheGreat, & @timetopretend8.

Please let us know if you have any questions. We can’t wait to see what you build with the Accessory Adjustment APIs in Avatar Editor experiences!

Happy creating!

120 Likes

This topic was automatically opened after 10 minutes.

Seems pretty nice! Although moderation sounds like its going to get potentially a lot worse, you might need to make some new detection for that, but glad to have more control overall!

16 Likes

So, in the future will it be possible to do 360° rotations?

When I kept track of this feature, I noticed that the Avatar Rules for it were completely different and hard coded into the Universal App, it had all the other Accessory Types, except Hair enabled. One of the rules allowed you to do 360° rotations for the Hat.

I actually wrote the initial Avatar Rules for it down, in a JSON Format.

3 Likes

Revolutionary! Can’t wait to see how developers use this.

4 Likes

Hey, loving the recent updates you’ve been rolling out! However, I noticed one potential issue. Like @DrAdministration mentioned (sorry for mention), there’s a chance it could be bypassed. I was also wondering, does this apply to all accessory adjustments such as size, rotation, and position? And is there an ETA on when other in-game accessory options will be available?

Also, I’d love to know is if there are any upcoming features related to avatar customization that we should look out for. Are there plans to expand beyond Head and Face accessories soon? Or even any other accessory types?

Another thing, how does the PromptCreateOutfit feature work with the new APIs? Are there any tips or things to avoid when using this in our games?

Alright, that’s enough yapping. Basically, this is a fantastic update, just looking for an ETA on those additional accessory options.

4 Likes

we are only allowing Face and Head accessory adjustments at this time.

So that is why it wasn’t allowing me to adjust Back an Waist Accessories. :cry:

8 Likes

Hello
Can this be used for adjustment of accessories, which exist only inside the given game (and which are not being sold on the Marketplace) ?

5 Likes

Yes! An AccessoryDescription that references an Instance in your game can have adjustment data and use the data when applying the HumanoidDescription.

7 Likes

The cursed NSFW-ish tongue UGCs just got a lot more cursed.

But genuinely, nice work, Roblox! This will let me express my avatar creativity far easier then before!

3 Likes

I’ve been playing around with accessory adjustment ever since it released last month, really amazing feature that we’ve definitely been needing for years. Since there’s finally an announcement thread on this, I want to ask a few things:


[1] Why are position/rotation/scale values automatically rounded to the nearest hundredth of a decimal? e.g. 0.957 would become 0.96


[2] If the Scale parameter is a Vector3, then why does the platform enforce uniform scaling? e.g. why can I not scale my accessories on only one or two axes, instead all 3 values have to be the exact same?

This feels like a seemingly pointless restriction that prevents a lot of potential with this feature, especially once more accessory types (especially ones that aren’t attached to the head) can be used with this feature.

R15 body scaling happens to affect your accessories, and I was hoping that this feature could be used to “reset” the automatic scaling of some of those accessories, by adjusting them back to a normal size. For example:

13 Likes

This is so awesome.

Currently, UGC creators have to make LOTS of variants of the same hats and stuff to cover all different positions and ways you can wear something but it be super cool if you can just tilt your hat and adjust the position of things.

Some accessories could form amazing combos since you can now just adjust their pose so they no longer clip or obstruct each other.

I recall that some hair, hats and ears don’t fit because they become this muddy mess, but being able to adjust them potentially solves this issue and allows for so much more expression!

Huge W feature.

9 Likes

30 fps ahh desktop app :100: :speaking_head: :fire: :fire:

7 Likes

Wait, so this is how people make those cool avatars :star_struck:

3 Likes

This is a slightly unrelated question, but are there plans for accessories inserted via InsertService to use MeshPart handles? Currently they still insert with part handles containing a SpecialMesh. I think now that we have SurfaceAppearance.Color (VertexColor replacement) and accessory adjustment, it would be great if we could opt into new insertion behavior. Thanks

3 Likes

The limits would be open to changing in the future! As for the old values, the feature was still WIP at the time so we changed to the current values after discussion.

3 Likes

YEAHHHHHH

I love this idea, usually to fix this was to try on multiple of similar accessory for one with the right size and position. But this is Golden!!!

3 Likes

We plan to allow accessory adjustment for other accessories soon! Likely Neck/Shoulder and Front/Back accessories.
For PromptCreateOutfit or PromptSaveAvatar being updated with this feature, you can now save accessory adjustments to the platform or user’s outfits (but they will be clamped within the limits given in AvatarEditorService:GetAvatarRules(). We were imagining a use case for in-experience Avatar Editors where devs could add their own UI to help the user adjust accessories and save to their account. In this case, our advice would be to use the values in avatarRules.AccessoryRefinementLowerBounds and avatarRules.AccessoryRefinementUpperBounds to know the min and max values for adjustments. For example, if you made a slider for Hat position adjustments in your Avatar Editor, you need avatarRules.AccessoryRefinementLowerBounds.Hat.Position.XPosition to get the minimum allowed X-axis adjustment limit, which is -0.25 at the moment. You can also call AvatarEditorService:ConformToAvatarRules() to make a HumanoidDescription clamp adjustment values.

7 Likes

That one in-game avatar saving function seems to have an issue. Not sure if it’s because it’s using v1, unless it uses v2 now, there was that Fast Flag about it once.

An Avatar can wear up to 10 Accessories of any type, and that in-game saving function cuts that away. Will that be fixed, so it doesn’t cut it away? :thinking:

2 Likes

Pretty cool adition but I have a question, are there any plans on making adjustments for avatar hair available too?

4 Likes