CharacterAdded event fires but character is not a member of workspace

When characteradded loads and i try to get the parent it comes as nil, i can’t do anything with the character

local function Player_Join_Game(Player)
	Player.CharacterAdded:connect(function(Character)
		print(Character.Parent)
	end)
end

Services.Players.PlayerAdded:connect(Player_Join_Game)

it always prints nil, if i try to get parent of character in any other script that activates after a couple seconds the character will be a member of workspace, why does characteradded not activate once the character is a member of workspace?

2 Likes

That’s how it is.

If you really need to make sure that the character is part of the workspace, you can

  1. add a :WaitForChild() for the character in workspace;
  2. use character:GetPropertyChangedSignal("Parent").

The fact that character’s parent is not defined yet doesn’t mean you can’t use it. All character components can still be accessed via character:WaitForChild("object_name").

In addition, the following represents loading event order for R15 characters.

image

Source: Player | Documentation - Roblox Creator Hub.

Thanks a lot man character:GetPropertyChangedSignal(“Parent”) works perfectly

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.