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?
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.
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