The wiki doesn't explain Rays very well and I'm trying to make a script that prints the distance of an object to what ever is intersecting the ray. Here is what I've got so far, no errors it just prints "0"
Part = script.Parent
local start = Vector3.new(Part.Position)
local lookAt = Vector3.new(start.X,(start.Y-100),start.Z)
local ray = Ray.new(start, (lookAt - start).unit)
print(ray:Distance(ray:ClosestPoint(lookAt)))

1 comment
Well, now it just prints "624750016", and the part is 34 studs above the baseplate, and I want it to print the distance to the baseplate.