Help with WaitForChild()

I am trying to call WaitForChild() on my character, but the script is trying to call it on the Workspace. Here’s my code:

game:GetService('Players').PlayerAdded:Connect(function(p)
	p.CharacterAppearanceLoaded:Connect(function(c)
		print(c)
		c:WaitForChild('HumanoidRootPart').Size = Vector3.new(1, script.Parent:WaitForChild('HumanoidRootPart').Size.Y, 1)
		c:WaitForChild('UpperTorso').CanCollide = false
		c:WaitForChild('LowerTorso').CanCollide = false
	end)
end)

Here’s a screenshot of the hierarchy, just in case you need it.
Screenshot 2025-03-01 164428
This is the output:


As you can see, it’s printing my character’s name as it’s supposed to, but instead of calling WaitForChild() on the character, it’s calling it on the Workspace.

Just in case you need to know. it’s a script in the workspace.

1 Like

this should be c.PrimaryPart

also you should use CharacterAdded instead of CharacterAppearanceLoaded because its unnecessary

2 Likes

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