I have a problem with GetUserThumbnailAsync because for some reason it’s not loading the image.
The game is published and api/http access is enabled.
It doesn’t throw any errors in the output.
code: (local script)
local Players = game:GetService("Players")
local player = Players:FindFirstChild(playerName)
-- Fetch the thumbnail
local userId = player.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
-- Set the ImageLabel's content to the user thumbnail
plrPicture.Image = content
Is “plrPicture” in size 420x420? Your code is exactly the same as the API Reference so if that isnt the error idk what happens
plrPicture.Size = UDim2.new (0, 420, 0, 420)
What if I want the plrPicture which is an image label to be scaled?
And I have another question which I think may be the problem. Will it work while play testing in studio with 2 players or it only works with actual accounts?
I guess you already saw the API Reference, there are several sizes like 48x48 or 60x60 you would just have to change thumbSize
Lets imagine 48x48
plrPicture.Size = UDim2.new (0, 48, 0, 48)
It wont, the dummy clients have fake userIds(-1, -2, -3 etc.) which wont show valid results. Also the in-game image size has nothing to do with the error.
PS: To test your code functionality, you could use
game.CreatorId(if it’s a published place) or pretty much any actual id(just make sure to change it back to
player.UserId when publishing the game).