LoadCharacter taking long time to respawn

Player:LoadCharacter works fine most of the time. However, in some cases, players experience a problem where LoadCharacter takes a really long time. I have also noticed that it might be related to “Players” network request time on server. If that is the case it would be nice to have a function which loads the character instantly and loads other assets (which require networks response) to be loaded on them later.

This is the code I use in game to respawn players

local respawnStart = tick()
while true do
	local s = pcall(function() Player:LoadCharacter() end)
	if s or not Player.Parent then
		break
	else
		wait(1)
        print("LoadCharacter failed")
	end
end
print("DEBUG - Character respawned:", tick() - respawnStart)

Server output
image

Server network

I am not entirely sure if that Network MaxTime is related to LoadCharacter but the time it took is fairly similar.

6 Likes