Title basically said it all.
This event fires for Scripts but not LocalScripts.
The documentation makes no mention of this behavior, so I’m filing it as a bug. If this is intended and should be a documentation request, I’ll make a feature request instead to ask for it on clients because there’s no reason for it not to be.
The event is important because I need my code to add all the character objects into a raycasting ignorelist and alter transparency, but CharacterAdded is fired while the character Model still has no children so I need to use the loaded event.
Currently, I use CharacterAdded with a wait(2)
in it.
Repro:
Reset your character a few times while checking the Output.
Script in ServerScriptService:
local Player = game.Players.PlayerAdded:Wait()
Player.CharacterAdded:Connect(function(Char)
print("CharacterAdded:",#Char:GetChildren())
wait(2)
print("CharacterAdded after 2 seconds:",#Char:GetChildren())
end)
Player.CharacterAppearanceLoaded:Connect(function(Char)
print("CharacterAppearanceLoaded:",#Char:GetChildren())
end)
LocalScript in StarterPlayerScripts:
local Player = game.Players.LocalPlayer
Player.CharacterAdded:Connect(function(Char)
print("CharacterAdded:",#Char:GetChildren())
wait(2)
print("CharacterAdded after 2 seconds:",#Char:GetChildren())
end)
Player.CharacterAppearanceLoaded:Connect(function(Char)
print("CharacterAppearanceLoaded:",#Char:GetChildren())
end)