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

How do I calculate a distance between 2 objects?

Asked by 7 years ago

I tried wiki and it didn't help nothing. I just need like a variable saying like:

distance = [Disance Here]

Does anyone know how to do that?

1 answer

Log in to vote
0
Answered by 7 years ago

It says it quite clearly on the wiki here: http://wiki.roblox.com/index.php?title=Magnitude

local magnitude = (part1.Position - part2.Position).magnitude
print(magnitude)
0
Ty. Didn't see that one. wilsonsilva007 373 — 7y
Ad

Answer this question