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

How to get the y elevention of the floor a player is standing on?

I am trying to create a part right at the player's foot. The part is very thin. My question is how do I get the y position right where the players feet touch the floor, based on the HumanoidRootPart's position. What I have tried is subtracting 3, and this sometimes works, but it will act weird if there is an r6 avatar or a different body scale. What is the reliable way to get the Y position of the bottom of a player's collision box, so that I can create a part right at their feet?

1 comment

1

use an if statement to determine what the avatar type is

1 answer

Hm. A good place to start is:

local leg = char:FindFirstChild(“Right Leg”)
local elevation = leg.Position.Y - leg.Size.Y/2

This would work for r6 obviously. You can do the same with bottom left leg in r15, so you just need to detect it. Like what @RobloxianDestory said, you need an if statement to detect if a character is in r6, or r15, then use the snippet above to find the bottom of a character’s leg using scale.

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