Hello - great update! Really looking forward to all of the possibilities this will lead to.
I have been experimenting with the AvatarEditorService:GetInventory()
method, and found it to produce unreliable results about 5-10% of the time. Using the following code in a LocalScript, I have received different results:
local AvatarEditorService = game:GetService("AvatarEditorService")
local assetTypes = {
Enum.AvatarAssetType.BackAccessory,
Enum.AvatarAssetType.ShoulderAccessory,
Enum.AvatarAssetType.WaistAccessory,
Enum.AvatarAssetType.Hat,
Enum.AvatarAssetType.HairAccessory,
Enum.AvatarAssetType.FaceAccessory,
Enum.AvatarAssetType.NeckAccessory,
Enum.AvatarAssetType.FrontAccessory,
}
AvatarEditorService:PromptAllowInventoryReadAccess() -- get access to inventory
local promptResult = AvatarEditorService.PromptAllowInventoryReadAccessCompleted:Wait()
if promptResult == Enum.AvatarPromptResult.Success then
local startTime = os.clock()
local pages = AvatarEditorService:GetInventory(assetTypes) -- get pages object
local inventory = {} -- table of all AssetIds
local function iterate(page) -- recursive func to iterate through pages object
for _, asset in pairs(page) do
table.insert(inventory, asset.AssetId)
end
if not pages.IsFinished then
pages:AdvanceToNextPageAsync()
iterate(pages:GetCurrentPage()) -- recurse with next page
end
end
iterate(pages:GetCurrentPage())
print(#inventory.. " accessories in your inventory; found in ".. (math.round((os.clock() - startTime) * 100) / 100).. " seconds")
end
Result #1: The expected result

This is the result that prints majority of the time, and is the correct result.
Result #2: The random result

Sometimes, this result prints randomly, with the accessories number ranging from 100-300. This is the incorrect result, and I’m not sure why its printing this.
Result #3: The error

Lastly, this will error randomly when I call the pages:AdvanceToNextPageAsync()
method. I am also not sure why this is occurring.
Is this a bug (if so, I can move this reply to a bug report), or an issue with my code? Any help would be appreciated, thank you!
Edit: I have moved this to a bug report as others have also been experiencing this, and there appears to be an issue with the page cursors.