Currently, the CharacterAdded event of the player instance fires whenever the character is added, which is great. Problem with this is the fact that the character sometimes isn’t completely loaded into the workspace when the event fires (Latency issues on the client/server can be the cause of this). This result in issues like server-scripts saying that the character doesn’t exist, or specific clothing items of the character not loading entirely (Some of us like to remove the clothing assets from a character when their character is added, but some clothing assets may not be fully loaded, which results in conflicts of clothing.
Currently, us developers have to come up with our own functions to make sure that the character is fully loaded, which is fine. That being said, for a newbie developer who is being introduced into programming, this can be frustrating and result in tedious and unneeded checking for errors in their code.
What I would like to see is simple: Have the CharacterAdded event fire ONLY after the character model has physically been created, and all the assets have been loaded (Ie: Hats, charactermeshes, shirts, faces, localscripts, and limbs.) This would be a less-hacky method, and would most likely be more efficient than any currently known method for waiting on the assets in a character. It would also leave new developers less confused, and save precious time when it comes to debugging.
As a work-around, we should have a Wiki article on this that explains that CharacterAdded fires the second the character is added and how to actually wait for [strike]the whole character is loaded.[/strike] most of the character to be loaded.
No support. This suggestion is based on a misunderstanding of what’s happening.
The character property is set before the assets are loaded onto it. This needs to be changed so that the character doesn’t exist until it’s loaded and characteradded doesn’t need to be touched.
If characteradded is changed to fire after the character is loaded, rather than after it’s added, lots and lots and lots of things will break.
To load all your clothing items, the game server has to hit the CharacterAppearance URL. Sometimes when there’s a slowdown this takes a couple of seconds, so ROBLOX goes ahead and spawns the character anyways.
A lot of game developers rely on CharacterAdded to teleport players somewhere as soon as they spawn. If CharacterAdded waited until your clothing loaded, this could break existing games because players might be falling to their deaths after they spawn. If you decide to prevent this by not spawning the character until every single asset on the character has loaded, that could significantly slow down the amount of time it takes to enter a game.
If anything, a separate CharacterLoaded event should fire after all the clothing/assets on a character have been loaded.
I added a note on the wiki. [url]Documentation - Roblox Creator Hub. Correct me if I’m wrong, but there’s no way to detect when the character has fully loaded.
[quote] To load all your clothing items, the game server has to hit the CharacterAppearance URL. Sometimes when there’s a slowdown this takes a couple of seconds, so ROBLOX goes ahead and spawns the character anyways.
A lot of game developers rely on CharacterAdded to teleport players somewhere as soon as they spawn. If CharacterAdded waited until your clothing loaded, this could break existing games because players might be falling to their deaths after they spawn. If you decide to prevent this by not spawning the character until every single asset on the character has loaded, that could significantly slow down the amount of time it takes to enter a game.
If anything, a separate CharacterLoaded event should fire after all the clothing/assets on a character have been loaded. [/quote]
I like your idea a lot more - what would actually be nice is to have a characterloaded property of the player (A boolean) that indicates that the character has fully loaded.
An alternative is to disable CharacterAutoLoads, and set the character to one you make yourself. You can use the Http Service to return all the assets a user is wearing, load it to their character, and only then set their character.
Player.CharacterLoaded(character) or Player.CharacterAppearanceLoaded(character) would be nice.
That way, CharacterAdded could still be used for instant teleport, and CharacterLoaded to dress when ready.