GetCharacterAppearanceAsync Deprecated what should I use?

GetCharacterAppearanceAsync is Deprecated anybody know the new varient?
I keep getting this error

  02:54:59.959  Players:GetCharacterAppearanceInfoAsync() failed because HTTP 400 (Bad Request)  -  Server - Loader:19
  02:54:59.959  Stack Begin  -  Studio
  02:54:59.959  Script 'Workspace.NpcGems.Loader', Line 19 - function updateModel  -  Studio - Loader:19
  02:54:59.959  Script 'Workspace.NpcGems.Loader', Line 42  -  Studio - Loader:42
  02:54:59.959  Stack End  -  Studio

This doesn’t mean it’s deprecated. It means there’s something wrong with the data you sent. It could either be just a Roblox problem, or it could be a problem with how you requested it. You can tell if a function is deprecated or not by looking at the api reference, as shown here.

The script I provided is the wrong one my mistake I’ll send the right one:

  02:54:59.958  Players:GetCharacterAppearanceAsync() failed because HTTP 400 (Bad Request)  -  Server - Loader:19
  02:54:59.959  Stack Begin  -  Studio
  02:54:59.959  Script 'Workspace.NpcRebirths.Loader', Line 19 - function updateModel  -  Studio - Loader:19
  02:54:59.959  Script 'Workspace.NpcRebirths.Loader', Line 42  -  Studio - Loader:42
  02:54:59.959  Stack End  -  Studio

If you’re in Studio you have to make sure HTTP Requests are enabled.

1 Like

It is enabled in studio

characterlimit

I’m pretty sure it is deprecated it says here

Where does it say that? I searched for the text “deprecated” on the page and it found nothing.

Click the link again I put the wrong link sorry

Ah, I see it now. It should still work, check if you have HTTP requests disabled in studio. However, it’s recommended you use GetCharacterAppearanceInfoAsync, since it isn’t deprecated. It basically does the same thing if you use :LoadAsset().

When I use Players:GetCharacterAppearanceInfoAsync() I get this error:

  02:54:59.959  Players:GetCharacterAppearanceInfoAsync() failed because HTTP 400 (Bad Request)  -  Server - Loader:19
  02:54:59.959  Stack Begin  -  Studio
  02:54:59.959  Script 'Workspace.NpcGems.Loader', Line 19 - function updateModel  -  Studio - Loader:19
  02:54:59.959  Script 'Workspace.NpcGems.Loader', Line 42  -  Studio - Loader:42
  02:54:59.959  Stack End  -  Studio

The script:

game.Players:GetCharacterAppearanceInfoAsync(UserId)

Please make sure you have HTTP requests turned on.

Allow HTTP Requests is on

characterlimit

Hmm, that’s unusual. How long has it been happening? Also, ensure the UserId is valid.

Ever since I put the script in, the UserId variable is:

local UserId = Model.UserId.Value

What is the value? Also, if the value is valid, do the other avatar-related functions work?

The value is the player’s userID so it would be my UserId so it is valid

I can’t check because when it loops through stuff it needs that to work

If this helps this is the source:

local Model = script.Parent

local autoUpd = true
local autoRefreshDuration = 60

local function resetModel()
	for i,v in pairs(Model:GetChildren()) do
		if v:IsA('CharacterMesh') or v:IsA('Shirt') or v:IsA('Pants') or v:IsA('Accessory') or v:IsA('ShirtGraphic') then
			v:Destroy()
		end
	end
	if Model.Head:findFirstChild('Mesh') then
		Model.Head.Mesh:Destroy()
	end
end

local function updateModel()
	local UserId = Model.UserId.Value
	local AppModel = game.Players:GetCharacterAppearanceAsync(UserId)
	for i,v in pairs(AppModel:GetChildren()) do
		if v:IsA('SpecialMesh') or v:IsA('BlockMesh') or v:IsA('CylinderMesh') then
			v.Parent = Model.Head
		elseif v:IsA('Decal') then
			Model.Head.face.Texture = v.Texture
		elseif v:IsA('BodyColors') or v:IsA('CharacterMesh') or v:IsA('Shirt') or v:IsA('Pants') or v:IsA('ShirtGraphic') then
			if Model:findFirstChild('Body Colors') then
				Model['Body Colors']:Destroy()
			end
			v.Parent = Model
		elseif v:IsA('Accessory') then
			v.Parent = Model
			v.Handle.CFrame = Model.Head.CFrame * CFrame.new(0, Model.Head.Size.Y / 2, 0) * v.AttachmentPoint:inverse()
		end
	end
	if not Model.Head:FindFirstChild('Mesh') then
		local m = Instance.new('SpecialMesh', Model.Head)
		m.MeshType = Enum.MeshType.Head
		m.Scale = Vector3.new(1.25, 1.25, 1.25)
	end
end

updateModel()

if autoUpd then
	while wait(autoRefreshDuration) do
		resetModel()
		updateModel()
	end
end

Where is this script? StarterPlayerScripts or StarterCharacterScripts?

Inside a Model also no other errors come from that script except from that