Let me clear it up a little. I want to check how tall a player is from their head up. Example: They havea default head and a massive hat on top of that. How would I check to see how tall they are with that hat?
You can’t really see what point the top of something is
The closest thing you can do is look at the Y position on the player’s head (assuming the map is at Y0)
Hm, are you positive that there is no way? I’m trying to make a nametag above players heads, but it gets buried in their hats.
From what I know, no, there is no way to do this.
To prevent it from getting buried in the players hats why don’t you try and change the offset or change the value of the position of the ui?
I was considering doing that. But if the player doesn’t have a hat, than it looks really far up.
True, maybe check if how many accessories they’re wearing then if it exceeds two then try and make it higher up? This is the best idea that I can think of, while it won’t work 100% of the time it will sometimes
All right. I’m going to leave the topic unsolved for now but if I don’t get a successful reply, I’ll give you the solution.
Can’t you get the right leg, then the lower torso, upper torso and then the head?
Adding all of these values should give you how tall someone is
Ah solved it. I used bounding box and cut the Y axis in half. Thank you for the replies!
But won’t that also include the hat?
That was the idea. I wanted to include everything on the character.
OMG, I READ THIS SO WRONG LOL. If I read it well I would have told you, sorry
local Game = game
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local function GetCharacterHeight(Character)
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Head = Character:FindFirstChild("Head")
if not (Humanoid and Head) then return end
local RigType = Humanoid.RigType.Name
local LeftLeg = if RigType == "R6" then Character:FindFirstChild("Left Leg") elseif RigType == "R15" then Character:FindFirstChild("LeftLowerLeg") else nil
if not LeftLeg then return end
local TallestHandle, TallestHeight = nil, 0
for _, Child in ipairs(Character:GetChildren()) do
if not (Child:IsA("Accessory")) then continue end
local Handle = Child:FindFirstChild("Handle")
if not Handle then continue end
if (Handle.Size.Y < TallestHeight) then continue end
TallestHeight = Handle.Size.Y
TallestHandle = Handle
end
local Height = if TallestHandle then (TallestHandle.Position.Y + TallestHandle.Size.Y / 2) - (LeftLeg.Position.Y - LeftLeg.Size.Y / 2) else (Head.Position.Y + Head.Size.Y / 2) - (LeftLeg.Position.Y - LeftLeg.Size.Y / 2)
return Height
end
task.wait(1)
local Height = GetCharacterHeight(Character)
print(Height) --5.85...