Retrieve thumbnail of a UGC item

Hey is there any support for UGC on this

When i use asset and the id of an UGC, it shows the UGC item but unrendered completely gray

2 Likes

MarketPlaceService has a GetProductInfo() function that returns information about an asset. One of the returned variables is called IconImageAssetId which gives you an Image Id for the asset’s icon. This doesn’t only work for gamepasses and developer products as said in the documentation. I’ve tried using this for other purposes such as Universe Icon. I’m unsure if this method will work for Avatar Assets, because Roblox uses a different system for that.

It tells me that the name of the UGC item is RenderMesh and that the description of it is RenderMesh

Actually I have just made a realisation.

The thing is im making a catalog-style game, and i’ve made a script that returns the ID’s of all accessories after looping through a character model.

It seems that these ID’s that it is returning to me are incorrect however

Avatar assets have a different way of showing up on the Catalog.
If I’m right, you would like to create a preview of the avatar asset?

Yes you are correct and i have just realised my mistake
I was looping through a character model and getting the MeshId, because I believed it would be the same as the AssetId.

Now my problem is not knowing how to retrieve the AssetId from an accessory

Try using GetCharacterAppearanceInfoAsync().

After you get the correct Id of the avatar asset, insert it inside a ViewPortFrame using InsertService:LoadAsset() and create a Roblox-like preview of Avatar assets.

Use “rbxthumb://type=Asset&id=[ASSET_ID]&w=420&h=420” and replace [ASSET_ID] with the id and set it to the image of an image label

3 Likes

Can i use GetCharacterAppearanceInfoAsync() on a model?

You have to use it on a player instance. To get it from a model, you can do:

game.Players:GetPlayerFromCharacter(character) 

the model does not belong to any players however

I have never tried this, but you can try Humanoid:GetAccessories().

it gets the accessories which i already can do, im trying to get the assetid from the accessory

I ran out of ideas, sorry. If I think of something, I’ll post it here.

Thanks alot for trying to help, ill let you know if i find the solution

1 Like

Just a quick question. Do you only want to make previews with it?

I would like to also get their assetid’s so I can prompt the purchases

Use Humanoid:GetAppliedDescription() and iterate through the returned humanoid description’s properties instead, then just pass these IDs to the endpoint @Joephiss mentioned. This should work with UGC accessories as well as stock Roblox ones.

You can use this:
local url = “rbxthumb://type=Asset&id=”…game.PlaceId

–or

local url = “rbxthumb://type=Asset&id=”…game.PlaceId…"&w=100&h=100"

However, it does not work for all UGC items. You will have to be the owner or have a lot of favorited items to get it to work.