AvatarCreationService
*Dieser Inhalt wurde mit KI (Beta) übersetzt und kann Fehler enthalten. Um diese Seite auf Englisch zu sehen, klicke hier.
AvatarCreationService ist ein service, der entwickler-avatar-ersteller unterstützt, indem er methoden bereitstellt, die die aufforderung zur erstellung von avataren aus erlebnissen unterstützen.
Zusammenfassung
Methoden
Erhalte Daten über Regeln, die Assets einhalten müssen, um die UGC-Validierung zu bestehen.
Holen Sie sich die Details des Avatar-Erstellungsymbols für eine Liste von Avatar-Erstellungsymbolen auf einmal.
- PromptCreateAvatarAsync(tokenId : string,player : Player,humanoidDescription : HumanoidDescription):Tuple
Fragt einen Player nach, einen Avatar aus einem HumanoidDescription zu kaufen und zu erstellen.
- ValidateUGCAccessoryAsync(player : Player,accessory : Instance,accessoryType : Enum.AccessoryType):Tuple
Nur Studio. Führt UGC-Validierung für ein Enum.AccessoryType durch.
Nur Studio. Führt UGC-Validierung für ein Enum.BodyPart durch.
Nur Studio. Führt die UGC-Validierung für einen ganzen Körper durch.
Events
- AvatarModerationCompleted(outfitId : number,moderationStatus : Enum.ModerationStatus):RBXScriptSignal
Eigenschaften
Methoden
GenerateAvatar2DPreviewAsync
Parameter
Rückgaben
LoadAvatar2DPreviewAsync
Parameter
Rückgaben
LoadGeneratedAvatarAsync
Parameter
Rückgaben
PromptCreateAvatarAsync
Parameter
Rückgaben
Code-Beispiele
local AvatarCreationService = game:GetService("AvatarCreationService")
export type BodyPartInfo = {
bodyPart: Enum.BodyPart,
instance: Instance, --Folder with Created MeshParts
}
export type BodyPartList = { BodyPartInfo }
local function publishAvatar(bodyPartInstances: BodyPartList, player: Player, tokenId: string)
local humanoidDescription = Instance.new("HumanoidDescription")
for _, bodyPartInfo in bodyPartInstances do
local bodyPartDescription = Instance.new("BodyPartDescription")
bodyPartDescription.Instance = bodyPartInfo.instance
bodyPartDescription.BodyPart = bodyPartInfo.bodyPart
bodyPartDescription.Parent = humanoidDescription
end
local pcallSuccess, result, resultMessage = pcall(function()
return AvatarCreationService:PromptCreateAvatarAsync(tokenId, player, humanoidDescription)
end)
if pcallSuccess then
if result == Enum.PromptCreateAvatarResult.Success then
print("Successfully uploaded with BundleId: ", resultMessage)
else
print("Unsuccessfully uploaded with error message:", resultMessage)
end
else
print("Avatar failed to create.")
end
end