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

How do i find the Z distance between two parts?

Asked by 7 years ago

I simply want to know how do you find the Z distance ( z being the position.Z property) between two parts

1
Simply subtract the z components of the position vectors. GoldenPhysics 474 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Hello y0ucef123, I just want to point out that this isn't a request website, but I can still try to help you because it seems that you are lost and do not know where to start.

In order to find the distance between two parts you can use Magnitude

To find the distance simply do:

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

I hope this is what you were looking for and be sure to check the ROBLOX Wiki when you feel lost.

Thanks and be sure to accept answer if this works!

Ad

Answer this question