How could I get the height of the player, by default a roblox-player is 5.5 studs tall.
But this is changeable in the avatar settings.
How could I get the players height using lua.
How could I get the height of the player, by default a roblox-player is 5.5 studs tall.
But this is changeable in the avatar settings.
How could I get the players height using lua.
You can use hrp.Position.Y
or get the height from the head
Honestly, I wouldn’t recommend you do this as if a player jumps, his height will be higher.
Instead, you should add an attachment into the head and the players foot and see the magnitude from there and that’d be your character height.
What about something like this?
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player: Player)
Player.CharacterAdded:Connect(function(Character)
local LowerAttachment = Instance.new("Attachment", Character.LeftFoot)
local HigherAttachment = Instance.new("Attachment", Character.Head)
print((LowerAttachment.Position - HigherAttachment.Position).Magnitude)
end)
end)
Model:GetExtentsSize()
local ModelSize = Character:GetExtentsSize()
print(ModelSize.Y) -- Players Height
This doesn’t work that well.
As It’s not measuring the whole players Y only the root-part ( i think )
which really does not help.
It measures the smallest bounding box that countains all BaseParts.
How would this be helpful for retrieving the whole players Y-cord?
You do that based off the HumanoidRootPart
's Position (or the PrimaryPart of a Model), not based off of Player Height.
Ok…
And…
I’m looking for the player’s height.
HumanoidRootPart.Position.Y + (ModelSizeY / 2)
I was just experimenting, and I think you can use the Humanoid’s hip height and multiply it by 2.5 to get the height of the player e.g. Humanoid.HipHeight * 2.5
. This should cover from the feet of the player to the top of the head of the player
local A = Head.Size.Y
local B = Torso.Size.Y
local C = Left_Leg.Size.Y
local Height = A+B+C
Might look something like this?
assuming you’re referring to a R15 rig you could probably use the height scaling in the humanoid. I don’t know how exactly but maybe try something like 5.5*height value
another way could be to just add together every parts Y size only taking one leg into the counting of course
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.