I found this post and saw that @CodeWriter said that CharacterAdded fires before the character is added to workspace. But on the wiki, it says that CharacterAdded
fires when the character is added to workspace. Is the wiki wrong or has the behavior changed since that post?
documentation
1 Like
local event, added
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
print(character.Parent) -- print's nil, so CharacterAdded fires just before parent is actually set to workspace.
event = tick()
character.AncestryChanged:Connect(function(parent)
print(character.Parent) -- print's workspace
added = tick()
print(added-event) -- time elapsed between .CharacterAdded event and actual acknowledgement of parent == workspace
end)
end)
end)
would be nice if documentation was specific.
2 Likes
Ah I see. Don’t you think that behavior is messed up though? Like, who needs to access the player before it goes into workspace
? It makes much more sense and will prevent many errors/warnings if the event fires after the character is added to the workspace
. Especially relating to the Humanoid
because some methods of the humanoid error if it’s not a descendant of the game object… I should make this a feature request though
1 Like
Hi,
Thanks for the report. We’ve corrected our documentation to reflect this.
If you feel this behavior is unintuitive I encourage you to file a feature request.
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.