Skip to content
Roblox API Reference

AvatarCreationService

A service to support developer avatar creators.
  • Not creatable
  • Service
Memory category
Instances
Own members
33
Inherited members
75
Subclasses
0
Siblings
608

Properties23

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Methods62

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byAvatarCreationService20
  • AvatarCreationService:AutoSetupAvatarAsync(player: Player,autoSetupParams: { [string]: any },progressCallback: ((...any) -> ...any)?,): string
    Automatically sets up a custom Model and/or avatar accessories.
    • Yields
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    player: Player
    The Player that the avatar is being set up for.
    autoSetupParams: { [string]: any }
    A table containing the arguments. Type: type AutoSetupAccessory = { AccessoryType: Enum.AccessoryType, IsLayered: bool, Instance: Model, } type AutoSetupParams = { Body: Model?, Accessories: {AutoSetupAccessory}, }
    progressCallback: ((...any) -> ...any)?
    Optional callback function that will be invoked periodically with a progressInfo table with the overall progress (from 0 to 1). Type: (progressInfo: { Progress: number }) -> ()
    Returns
    TypeDescription
    string
    A unique identifier for the generated avatar.
  • AvatarCreationService:CreateCageMeshPartsWithScaleForExportAsync(model: Model): Folder
    • Yields
    • Roblox script security
    Parameters
    Parameter
    model: Model
    Returns
    Type
    Folder
  • AvatarCreationService:DeserializeAvatarModel(serializedModel: string): Instance
    • Roblox script security
    Parameters
    Parameter
    serializedModel: string
    Returns
    Type
    Instance
  • AvatarCreationService:GenerateAvatar2DPreviewAsync(avatarGeneration2dPreviewParams: { [string]: any },progressCallback: ((...any) -> ...any)?,): string
    Creates a 2D avatar preview and returns a previewId.
    • Yields
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    avatarGeneration2dPreviewParams: { [string]: any }
    A table of arguments for 2D preview generation. Type: avatarGeneration2dPreviewParams: {SessionId: string, FileId: string, TextPrompt: string?}
    progressCallback: ((...any) -> ...any)?
    Optional callback function that will be invoked periodically with a progressInfo table with the overall progress (from 0 to 1). Type: (progressInfo: { Progress: number }) -> ()
    Returns
    TypeDescription
    string
    A string previewId
  • AvatarCreationService:GenerateAvatarAsync(avatarGenerationParams: { [string]: any },progressCallback: ((...any) -> ...any)?,): string
    Generates an avatar and returns a generationId.
    • Yields
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    avatarGenerationParams: { [string]: any }
    A table of arguments for generating an avatar. Type: avatarGenerationParams: {SessionId: string, PreviewId: string}
    progressCallback: ((...any) -> ...any)?
    Optional callback function that will be invoked periodically with a progressInfo table with the overall progress (from 0 to 1). Type: (progressInfo: { Progress: number }) -> ()
    Returns
    TypeDescription
    string
    A string generationId.
  • AvatarCreationService:GetBatchTokenDetailsAsync(tokenIds: { any }): { any }
    Gets the avatar creation token details for a list of avatar creation tokens at once.
    • Yields
    • Capabilities: Monetization
    Parameters
    ParameterDescription
    tokenIds: { any }
    The list of avatar creation token IDs to get details of.
    Returns
    TypeDescription
    { any }
    Array of avatar creation token details as outlined above.
  • AvatarCreationService:GetValidationRules(): { [string]: any }
    Gets data regarding rules that assets must abide by to pass UGC validation.
    • Custom Lua state
    Returns
    TypeDescription
    { [string]: any }
    Dictionary of validation rules as detailed above.
  • AvatarCreationService:HandleSelfieConsentResult(consentAccepted: boolean)
    • Roblox script security
    Parameters
    Parameter
    consentAccepted: boolean
  • AvatarCreationService:HandleSelfieQRResult(success: boolean,resultString: string,)
    • Roblox script security
    Parameters
    Parameter
    success: boolean
    resultString: string
  • AvatarCreationService:LoadAvatar2DPreviewAsync(previewId: string): EditableImage
    Load an AvatarGeneration 2D preview on the client from a previewId.
    • Yields
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    previewId: string
    Load the preview generated from GenerateAvatar2DPreviewAsync().
    Returns
    TypeDescription
    EditableImage
    An EditableImage containing the preview image.
  • AvatarCreationService:LoadGeneratedAvatarAsync(generationId: string): HumanoidDescription
    Loads a generated avatar using an avatar generation ID.
    • Yields
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    generationId: string
    A unique string that identifies the generated avatar, as returned by AutoSetupAvatarAsync().
    Returns
    TypeDescription
    HumanoidDescription
    The HumanoidDescription of the generated avatar, which includes all the generated instances and properties.
  • AvatarCreationService:PrepareAvatarForPreviewAsync(humanoidModel: Model)
    Prepares in-experience avatar for preview.
    • Yields
    • Capabilities: AvatarAppearance
    Parameters
    ParameterDescription
    humanoidModel: Model
    The Model containing MeshPart children with WrapDeformer instances that require HSR data updating for preview.
  • AvatarCreationService:PromptCreateAvatarAssetAsync(tokenId: string,player: Player,assetInstance: Instance,assetType: Enum.AvatarAssetType,): ...any
    Prompts a Player to purchase and create an avatar asset from an Instance.
    • Yields
    Parameters
    ParameterDescription
    tokenId: string
    The ID of a creation token. The token must be valid in that the universe the method is called from is the same universe the token was created for. Furthermore, the token creator must maintain ID verification and Roblox Premium (opens in a new tab). To create a token for utilization in this API, follow the token creation (opens in a new tab) process. The token's creation type must match the AvatarAssetType passed in to the method.
    player: Player
    The Player intended to be presented with the creation prompt.
    assetInstance: Instance
    The Instance of the avatar asset intended for creation.
    assetType: Enum.AvatarAssetType
    The AvatarAssetType of the expected creation. This must match the creation type of the provided token.
    Returns
    TypeDescription
    ...any
    A tuple containing, in order:
    • An PromptCreateAssetResult indicating the result of the creation prompt.
    • A string result. In the case of PromptCreateAssetResult.Success, this will indicate the asset ID. In the case of any failure enum, this will indicate the resultant error message.
  • AvatarCreationService:PromptCreateAvatarAsync(tokenId: string,player: Player,humanoidDescription: HumanoidDescription,): ...any
    Prompts a Player to purchase and create an avatar from a HumanoidDescription.
    • Yields
    • Capabilities: AssetCreateUpdate + Monetization
    Parameters
    ParameterDescription
    tokenId: string
    The ID of an avatar creation token. The token must be valid in that the universe the method is called from is the same universe the token was created for. Furthermore, the token creator must maintain ID verification and Roblox Premium (opens in a new tab). To create a token for utilization in this API, follow the token creation (opens in a new tab) process.
    player: Player
    The Player intended to be presented with the creation prompt.
    humanoidDescription: HumanoidDescription
    The HumanoidDescription of the avatar intended for creation.
    Returns
    TypeDescription
    ...any
    A tuple containing, in order:
    • An PromptCreateAvatarResult indicating the result of the creation prompt.
    • A string result. In the case of PromptCreateAvatarResult.Success, this will indicate the bundle ID. In the case of any failure enum, this will indicate the resultant error message.
    • A secondary optional string result. In the case of PromptCreateAvatarResult.Success, this will indicate the outfit ID. In the case of any failure enum, this will be nil.
  • AvatarCreationService:PromptCreateMakeupAsync(player: Player,makeupAssetEntries: { any },thumbnailHeadColor: Color3? = nil,): ...any
    • Yields
    • Capabilities: AssetCreateUpdate + Monetization
    Parameters
    Parameter
    player: Player
    makeupAssetEntries: { any }
    thumbnailHeadColor: Color3? = nil
    Returns
    Type
    ...any
  • AvatarCreationService:PromptSelectAvatarGenerationImageAsync(player: Player): string
    Prompt the Player to take a selfie and return the FileId.
    • Yields
    • Capabilities: SensitiveInput
    Parameters
    ParameterDescription
    player: Player
    The Player to prompt for taking a selfie.
    Returns
    TypeDescription
    string
    A string FileId of the selfie on success, or an error string describing the reason for failure.
  • AvatarCreationService:RequestAvatarGenerationSessionAsync(player: Player,callback: (...any) -> ...any,): ...any
    Request an AvatarGeneration session for a Player.
    • Yields
    • Capabilities: DynamicGeneration
    Parameters
    ParameterDescription
    player: Player
    The Player to request an AvatarGeneration session for.
    callback: (...any) -> ...any
    Callback function that is invoked with a SessionInfo table, with information about the session. Type: (SessionInfo: { SessionId: string, Allowed2DGenerations: number, Allowed3DGenerations: number, SessionTime: number }) -> ()
    Returns
    TypeDescription
    ...any
    A tuple containing a RBXScriptConnection that can be used to cancel the session request and the estimated wait time in seconds.
  • AvatarCreationService:ValidateUGCAccessoryAsync(player: Player,accessory: Instance,accessoryType: Enum.AccessoryType,): ...any
    Studio only. Runs UGC validation for an AccessoryType.
    • Yields
    Parameters
    ParameterDescription
    player: Player
    The Player validation is completed for.
    accessory: Instance
    The instance validation is run on.
    accessoryType: Enum.AccessoryType
    The AccessoryType the instance is expected to be.
    Returns
    TypeDescription
    ...any
    A tuple containing, in order:
    • A boolean indicating if validation was successful for the accessory.
    • An optional table of strings. This includes failure reasons if validation was unsuccessful; otherwise nil if validation was successful.
  • AvatarCreationService:ValidateUGCBodyPartAsync(player: Player,instance: Instance,bodyPart: Enum.BodyPart,): ...any
    Studio only. Runs UGC validation for an BodyPart.
    • Yields
    Parameters
    ParameterDescription
    player: Player
    The Player validation is completed for.
    instance: Instance
    The instance validation is run on.
    bodyPart: Enum.BodyPart
    BodyPart the instance is expected to be.
    Returns
    TypeDescription
    ...any
    A tuple containing, in order:
    • A boolean indicating if validation was successful for the body part.
    • An optional table of strings. This includes failure reasons if validation was unsuccessful; otherwise nil if validation was successful.
  • AvatarCreationService:ValidateUGCFullBodyAsync(player: Player,humanoidDescription: HumanoidDescription,): ...any
    Studio only. Runs UGC validation for a whole body.
    • Yields
    Parameters
    ParameterDescription
    player: Player
    The Player validation is completed for.
    humanoidDescription: HumanoidDescription
    HumanoidDescription representing the body that validation is run on.
    Returns
    TypeDescription
    ...any
    A tuple containing, in order:
    • A boolean indicating if validation was successful for the body.
    • An optional table of strings. This includes failure reasons if validation was unsuccessful; otherwise nil if validation was successful.

Events23

Inherited fromObject1
Inherited fromInstance9
Defined byAvatarCreationService13