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

Height From The Ground?

I need a way to find out the distance between the character's root part, and the ground directly below. How would I go about doing this?

1 comment

0

Very vague . "ground" ?

2 answers

Vector3.magnitude

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char.HumanoidRootPart

local mag = (hrp.Position - workspace.Baseplate.Position).magnitude

print(math.floor(mag))
local SomeNumber = 0
while wait(.25) do
SomeNumber = game.Players.LocalPlayer.HumanoidRootPart.Position.Y
print("SomeNumber")
end

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