Getting the number of studs since

I was wondering how I could get the distance between two objects; I need help with that, how would I calculate that?

– I guess those are called studs

1 Like

To find the distance between 2 parts, just do this:

(Part1.Position-Part2.Position).Magnitude

You can use .Magnitude to get the distance between 2 Vector3 values.

local partOne = Instance.new('Part', workspace)
partOne.Position = Vector3.new(10, 50, 10)

local partTwo = Instance.new('Part', workspace)
partTwo.Position = Vector3.new(-10, -50, -10)

local myDistance = (partOne.Position - partTwo.Position).Magnitude -- the number of studs between those 2 values.
3 Likes