AppearanceLoaded. Or did it?

local function givenChar(character,isMine,player)	

		
	local elap = 0
	while elap < 1 and not player:HasAppearanceLoaded() do
		local t=tick()
		wait()
		elap=elap+tick()-t
		print("WAITED",elap) warn("WAITED",elap)
	end	
	if elap>=1 then print("TIMEOUT") warn("TIMEOUT") end
	if player:HasAppearanceLoaded() then warn("APPEARANCE LOAD SUC") print("APPEARANCE LOAD SUC") end

				
	if isMine then
--makes the ragdoll constraints

What is wrong with this? This error happened only once in studio out of 20 runs and happens every fifth or so in the actual game. I have no idea what’s going on and I don’t want to coroutine-waitforchild or pcall every joint I have to add.

I’m thinking now, how should I detect a fully loaded character on the client, then?

1 Like

Here’s like the ugliest way I think I could do it but if you have a better idea I’m up for it!

	local character = ragSystem.Character
	character:WaitForChild('LeftUpperArm')
	character:WaitForChild('LeftLowerArm')
	character:WaitForChild('LeftUpperLeg')
	character:WaitForChild('LeftHand')
	character:WaitForChild('LeftLowerLeg')
	
	character:WaitForChild('LeftFoot')
	character:WaitForChild('UpperTorso')
	character:WaitForChild('LowerTorso')
	character:WaitForChild('RightUpperArm')
	character:WaitForChild('Head')
	
	character:WaitForChild('RightLowerArm')
	character:WaitForChild('RightHand')
	character:WaitForChild('RightUpperLeg')
	character:WaitForChild('RightLowerLeg')
	character:WaitForChild('RightFoot')
	
	character:WaitForChild('HumanoidRootPart')
	 

The way I wait for characters in my game is by using the following:

local Character = Player.Character or Player.CharacterAdded:Wait()
if (not Character.Parent) then Character.AncestryChanged:Wait() end
RunService.RenderStepped:Wait()

However, I should note that I do not load character appearance as I have a custom avatar editor and saving/loading system. This is the code I use to wait for a character rig to load before teleporting them to the correct room, and then loading in their appearance.

This code is also run by the server, not the client; so I have no idea how it’ll perform client side.

Yes, very different situation. In the case of what I’m doing, which is the general case

(from https://devforum.roblox.com/t/what-is-guaranteed-to-be-there-on-characteradded/42431)

There’s all kinds of weird stuff you have to deal with like 3.0s having all their baseParts loaded twice (in the event Roblox is under strain and their appearance does not load, they still have a rig to play with)

Oddly enough that only destroys the collisionIds, not the constraint references, apparently :man_shrugging: