Hello. I am attempting to detect if a player’s character has or not fully loaded.
My objective is to be able to use the server to alter their outfits, but that is not possible if said outfits have not loaded in yet.
When CharacterAdded() runs, the character is spawned in with all the default components in it; Humanoid, HumanoidRootPart, Torso, Legs, Arms, ETC. However, it takes a moment (probably a few milisseconds, or a little less than a second, maybe more, I have not counted) for the classic outfits and accessories to get added into the character, which frankly, is fine by me. Or rather, it would be, if only HasAppearanceLoaded() was reliable for this use-case.
See, I have read the documentation, and so, did the following attempt to solve the problem: Whenever CharacterAdded runs, a simple loop keeps checking for HasAppearanceLoaded() until it’s true.
while not player:HasAppearanceLoaded() do
task.wait(0.2)
end
Simple, no? Should take it only one or two attempts. But what they don’t tell you is that HasAppearanceLoaded() fails to work when a character is added after the first time.
That is to say;
When the player is first joining the game, it works like a charm, but whenever the character resets, HasAppearanceLoaded() stops working completely, returning true at all times.
And don’t get me wrong, HasAppearanceLoaded() is a method that you run on the PLAYER object, which means that this is most likely intended behavior, yes? Because the player object never has to load more than once. I understand, yes.
Well, if that is the case, it would be great if they made that clear in the documentation, since they only lightly imply that it only works once, with:
This is useful when determining whether a player’s appearance has loaded after they first join the experience
Check source for more info: https://create.roblox.com/docs/reference/engine/classes/Player#HasAppearanceLoaded
EDIT: Turns out HasAppearanceLoaded() does work as intended, but only to an extent. It so happens that when CharacterAdded() is triggered, for some reason, HasAppearanceLoaded() is ALREADY TRUE, which doesn’t make any sense, since the character is in fact, not fully loaded. The definition of “loaded” may vary, but by that I say, not all the necessary components are present there. That being said, the question stands;
2nd EDIT: This is an R6 only issue. See solution for more information.
Is there any realiable way I can use to check if the character has completed loading when it spawns in once more, especifically after resetting?