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
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
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.