Documentation for RaycastResult.Distance is missing

The RaycastResult API reference doesn’t mention the Distance property.

Example usage:

local r = game:GetService"Workspace":Raycast(Vector3.new(0,1,0),Vector3.new(0,-2,0))
print(r and string.format("%.0f studs",r.Distance) or "no hit")

The Distance property represents the distance between the origin of the raycast and hit position.

12 Likes