Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I can't find BodyWidthScale, BodyDepthScale and BodyHeightScale in-game?

The below code is supposed to find the BodyWidthScale, BodyHeightScale and BodyDepthScale inside the R15 Character's Humanoid. It does work in Studio, however, if I run this in a server, None of these Values are a child of Humanoid, in fact, they aren't even a descendant of the Character.

Did ROBLOX remove these Values? If they did, are there any other way to get the Scale properties of R15 Character bodies?

The script is being ran in a Server-Script.

local plrs = game:GetService("Players")
plrs.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		local hum = char:WaitForChild("Humanoid")
		local BW = hum:WaitForChild("BodyWidthScale")
		local BH = hum:WaitForChild("BodyHeightScale")
		local BD = hum:WaitForChild("BodyDepthScale")
	end)
end)

Output:

-- Infinite yield possible on [character].Humanoid:WaitForChild("BodyWidthScale")

1 answer

✓ Accepted answer

###They are, children of the Humanoid, and that output message is just a warning, it will always be there when you use WaitForChild. It does not break scripts. The message is just saying the script could yield indefinitely if the child were to not be found. It is nothing to worry about, because the script didn't wait too long for the child.

On a side note, :connect() is deprecated, use :Connect() instead.

2 comments

0

If he's getting the message though, there is a high chance that the script /is/ actually yielding forever because it cannot find the child. This isn't always the case but a lot of the times it is.

0

OP later commented that "print(hum.BodyDepthScale == true)" printed false, which I later commented that it did that because objects are not booleans. They are truthy, but are not true.

This discussion is preserved as it was. New answers, comments, and votes are closed.