Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Find the distance between two things?

Asked by 9 years ago

How do you find the distance between a part and another part through a script?

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

To find how many studs are between two parts, you would use Magnitude

Example:

local magnitude = (part1.Position - part2.Position).magnitude
print(magnitude)
Ad

Answer this question