I am trying to find the distance between points and compare it with an integer which is the amount of studs.
magnitude = (part1.Vector3 - part2.Vector3).magnitude if magnitude <= 3 then -- code end
If magnitude doesnt return the distance measured in studs the above if statement would not run even if the distance is less than 3 studs.
So, Does magnitude return the amount of studs between points?
Yes, magnitude does return studs and they're the studs between a Vector3
value. Also, you should use magnitude = (part1.Position - part2.Position).magnitude
instead of part1.Vector3
as position returns their Vector3
position.