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

How can I find a local distance between 2 parts?

This is what I have tried, but this finds the Global distance:

distanceX = part1.CFrame.X - part2.CFrame.X

I have experimented with CFrame.lookVector, but I couldn't get that working either. Does anyone know how I can accomplish this?

1 comment

0

http://wiki.roblox.com/index.php?title=Magnitude <- Is this what you’re looking for?

1 answer

✓ Accepted answer

Vector.magnitude

print((part1.Position - part2.Position).magnitude)

1 comment

0

This worked! Thankyou!

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