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

How to find the Position between leftfoot and rightfoot?

I am trying to find the Position between the leftfoot and rightfoot how is this cauclated?

Reason Why I need this

I am teleporting a character onto a very thin platform which if I teleported onto the thin platform there's a chance I fall whenever I use :SetPrimaryPartCFrame on an humanoidrootpart

I need to find the position of leftfoot and right foot to avoid this

I also need the character to be on the middle which is why I need the position between leftfoot and rightfoot

2 answers

I'd recommend doing

player.Character.HumanoidRootPart.CFrame = CFrame.new(--the place you want to teleport them)

That should work:)

If you want to calculate the position between Left Foot and Right Foot, you can use the formula:

(LeftFoot.Position + RightFoot.Position) / 2

But, it is not recommended to do that using teleports. Because you cannot get the height of the leg, so you still get bugged either.

It is recommend to do this:

-- This is a LocalScript

local player = game.Players.LocalPlayer
local char = player.Character

char:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(0,0,0)

Why HumanoidRootPart? It is because HumanoidRootPart is the only instance in player character that exists in R6 and R15, meaning that you can teleport anyone to anywhere using the method.

But if you really really really want to get the position between LeftFoot and RightFoot, since in R15 there is "UpperRightLeg", "UpperLeftLeg" and more... So if you want to do that method, it depends on your Rig Type.

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